Skip to content

Commit db9ae71

Browse files
fix: date is not changable in signyourself flow of mobile
1 parent 7882c61 commit db9ae71

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

apps/OpenSign/src/components/pdf/Placeholder.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,21 @@ function Placeholder(props) {
144144

145145
return () => clearTimeout(timer);
146146
}, [props.pos]);
147+
148+
useEffect(() => {
149+
const closeMenuOnOutsideClick = (e) => {
150+
if (!isDraggingEnabled && !e.target.closest("#changeIsDragging")) {
151+
setDraggingEnabled(true);
152+
}
153+
};
154+
155+
document.addEventListener("click", closeMenuOnOutsideClick);
156+
157+
return () => {
158+
// Cleanup the event listener when the component unmounts
159+
document.removeEventListener("click", closeMenuOnOutsideClick);
160+
};
161+
}, [isDraggingEnabled]);
147162
//function change format array list with selected date and format
148163
const changeDateFormat = () => {
149164
const updateDate = [];

apps/OpenSign/src/components/pdf/PlaceholderBorder.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import React from "react";
22
import { themeColor } from "../../constant/const";
33
import {
44
defaultWidthHeight,
5+
isMobile,
56
radioButtonWidget,
67
resizeBorderExtraWidth
78
} from "../../constant/Utils";
@@ -30,7 +31,7 @@ function PlaceholderBorder(props) {
3031
};
3132
return (
3233
<div
33-
onMouseEnter={props?.setDraggingEnabled(true)}
34+
onMouseEnter={!isMobile && props?.setDraggingEnabled(true)}
3435
className="borderResize"
3536
style={{
3637
borderColor: themeColor,

0 commit comments

Comments
 (0)