File tree Expand file tree Collapse file tree 2 files changed +17
-1
lines changed
apps/OpenSign/src/components/pdf Expand file tree Collapse file tree 2 files changed +17
-1
lines changed Original file line number Diff line number Diff 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 = [ ] ;
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ import React from "react";
22import { themeColor } from "../../constant/const" ;
33import {
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 ,
You can’t perform that action at this time.
0 commit comments