fix: date is not changable in signyourself flow of mobile

This commit is contained in:
prafull-opensignlabs
2024-03-14 21:39:22 +05:30
parent 7882c61b81
commit db9ae71d67
2 changed files with 17 additions and 1 deletions
@@ -144,6 +144,21 @@ function Placeholder(props) {
return () => clearTimeout(timer); return () => clearTimeout(timer);
}, [props.pos]); }, [props.pos]);
useEffect(() => {
const closeMenuOnOutsideClick = (e) => {
if (!isDraggingEnabled && !e.target.closest("#changeIsDragging")) {
setDraggingEnabled(true);
}
};
document.addEventListener("click", closeMenuOnOutsideClick);
return () => {
// Cleanup the event listener when the component unmounts
document.removeEventListener("click", closeMenuOnOutsideClick);
};
}, [isDraggingEnabled]);
//function change format array list with selected date and format //function change format array list with selected date and format
const changeDateFormat = () => { const changeDateFormat = () => {
const updateDate = []; const updateDate = [];
@@ -2,6 +2,7 @@ import React from "react";
import { themeColor } from "../../constant/const"; import { themeColor } from "../../constant/const";
import { import {
defaultWidthHeight, defaultWidthHeight,
isMobile,
radioButtonWidget, radioButtonWidget,
resizeBorderExtraWidth resizeBorderExtraWidth
} from "../../constant/Utils"; } from "../../constant/Utils";
@@ -30,7 +31,7 @@ function PlaceholderBorder(props) {
}; };
return ( return (
<div <div
onMouseEnter={props?.setDraggingEnabled(true)} onMouseEnter={!isMobile && props?.setDraggingEnabled(true)}
className="borderResize" className="borderResize"
style={{ style={{
borderColor: themeColor, borderColor: themeColor,