fix: widgets dragging issue in mobile view

This commit is contained in:
RaktimaNXG
2024-01-30 17:12:29 +05:30
parent bc90da4cf2
commit 882b97da5e
12 changed files with 307 additions and 63 deletions
@@ -89,6 +89,7 @@ function SignYourSelf() {
});
const [isAlert, setIsAlert] = useState({ isShow: false, alertMessage: "" });
const [isDontShow, setIsDontShow] = useState(false);
const [isdraggingEnable, setIsDraggingEnable] = useState(false);
const divRef = useRef(null);
const nodeRef = useRef(null);
const [{ isOver }, drop] = useDrop({
@@ -108,6 +109,7 @@ function SignYourSelf() {
id: 1,
text: "signature"
},
canDrag: isdraggingEnable,
collect: (monitor) => ({
isDragSign: !!monitor.isDragging()
@@ -120,6 +122,7 @@ function SignYourSelf() {
id: 2,
text: "stamp"
},
canDrag: isdraggingEnable,
collect: (monitor) => ({
isDragStamp: !!monitor.isDragging()
@@ -134,7 +137,7 @@ function SignYourSelf() {
id: 3,
text: "drag me"
},
canDrag: false,
canDrag: isdraggingEnable,
collect: (monitor) => ({
isDragSignatureSS: !!monitor.isDragging()
})
@@ -147,6 +150,7 @@ function SignYourSelf() {
id: 4,
text: "drag me"
},
canDrag: isdraggingEnable,
collect: (monitor) => ({
isDragStampSS: !!monitor.isDragging()
})
@@ -179,6 +183,9 @@ function SignYourSelf() {
if (documentId) {
getDocumentDetails(true);
}
if (!isMobile) {
setIsDraggingEnable(true);
}
}, []);
useEffect(() => {
@@ -456,6 +463,9 @@ function SignYourSelf() {
} else if (dragTypeValue === "initials") {
setIsInitial(true);
}
if (isMobile) {
setIsDraggingEnable(false);
}
};
//function for send placeholder's co-ordinate(x,y) position embed signature url or stamp url
@@ -1030,6 +1040,8 @@ function SignYourSelf() {
isSignYourself={true}
addPositionOfSignature={addPositionOfSignature}
isMailSend={false}
setIsDraggingEnable={setIsDraggingEnable}
isdraggingEnable={isdraggingEnable}
/>
</div>
) : (