File tree Expand file tree Collapse file tree 1 file changed +4
-10
lines changed
Expand file tree Collapse file tree 1 file changed +4
-10
lines changed Original file line number Diff line number Diff line change @@ -132,24 +132,18 @@ const Dialog: React.FC<IDialogPropTypes> = (props) => {
132132 }
133133
134134 function onModulesMouseDownCapture ( e : React . MouseEvent ) {
135- if ( e . target === wrapperRef . current ) {
136- mouseDownOnMaskRef . current = true ;
137- } else {
138- mouseDownOnMaskRef . current = false ;
139- }
135+ mouseDownOnMaskRef . current = e . target === wrapperRef . current ;
140136 }
141137
142138 function onModulesMouseUpCapture ( e : React . MouseEvent ) {
143- if ( e . target === wrapperRef . current ) {
144- mouseUpOnMaskRef . current = true ;
145- } else {
146- mouseUpOnMaskRef . current = false ;
147- }
139+ mouseUpOnMaskRef . current = e . target === wrapperRef . current ;
148140 }
149141
150142 // ========================= Effect =========================
151143 useEffect ( ( ) => {
152144 if ( visible ) {
145+ mouseDownOnMaskRef . current = false ;
146+ mouseUpOnMaskRef . current = false ;
153147 setAnimatedVisible ( true ) ;
154148 saveLastOutSideActiveElementRef ( ) ;
155149
You can’t perform that action at this time.
0 commit comments