Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F2746832
D5315.id17539.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D5315.id17539.diff
View Options
diff --git a/web/modals/modal.react.js b/web/modals/modal.react.js
--- a/web/modals/modal.react.js
+++ b/web/modals/modal.react.js
@@ -31,10 +31,20 @@
withCloseButton = true,
} = props;
const overlayRef = React.useRef();
+ const firstClickRef = React.useRef(null);
- const onBackgroundClick = React.useCallback(
+ const onBackgroundMouseDown = React.useCallback(event => {
+ console.log(event.type, event.target);
+ firstClickRef.current = event.target;
+ }, []);
+
+ const onBackgroundMouseUp = React.useCallback(
event => {
- if (event.target === overlayRef.current) {
+ console.log(event.type, event.target);
+ if (
+ event.target === overlayRef.current &&
+ firstClickRef.current === overlayRef.current
+ ) {
onClose();
}
},
@@ -87,7 +97,8 @@
<div
className={css.modalOverlay}
ref={overlayRef}
- onClick={onBackgroundClick}
+ onMouseDown={onBackgroundMouseDown}
+ onMouseUp={onBackgroundMouseUp}
tabIndex={0}
onKeyDown={onKeyDown}
>
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Sep 19, 8:17 AM (2 h, 9 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2136146
Default Alt Text
D5315.id17539.diff (1 KB)
Attached To
Mode
D5315: [web] Closing modal with outside click changed
Attached
Detach File
Event Timeline
Log In to Comment