[MISC][XY] Prevent Drawer from closing during text selection#915
Open
ninjasheeps wants to merge 6 commits intomasterfrom
Open
[MISC][XY] Prevent Drawer from closing during text selection#915ninjasheeps wants to merge 6 commits intomasterfrom
ninjasheeps wants to merge 6 commits intomasterfrom
Conversation
qroll
requested changes
Dec 22, 2025
0f048fc to
0f26edd
Compare
qroll
reviewed
Dec 23, 2025
669c897 to
619ef5a
Compare
qroll
reviewed
Jan 8, 2026
Contributor
qroll
left a comment
There was a problem hiding this comment.
summing up our earlier discussion!
ModalandModalV2to implement this
const childRef = useRef<HTMLDivElement>(null);
const childWithRef =
children && React.cloneElement(children, { ref: childRef });
<Overlay containerRef={childRef}>
// other code here
{childWithRef} // instead of children
</Overlay>
ModalV2.Cardto forward the refOverlayto also restore thechildWithReflogic- In
Overlay's handleWrapperClick, the container will becontainerRef?.current ?? childWithRef?.current
03e3f7d to
04ed97b
Compare
qroll
reviewed
Feb 8, 2026
…loneElement compatibility
c32fef9 to
f57bb60
Compare
Contributor
|
was updating the docs and realised the behaviour was still inconsistent on certain examples (e.g. on the Overlay stories) I've tried tweaking the logic here: 7f1706b
does this make sense to you? |
Contributor
Author
|
yep, this makes sense to me. thank you so much for working on this!! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes
Fixed issue where drawer would auto-close when users highlight text inside the drawer and drag their mouse outside of drawer
Changes:
Added
handleDocumentMouseDownlistener to track interaction originUpdated
handleWrapperClickto close drawer if both mousedown AND click happened outside of drawerdelete branch