-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: popup closes on context menu copy #1453
fix: popup closes on context menu copy #1453
Conversation
@Raubzeug @artemmufazalov ping |
@@ -0,0 +1,5 @@ | |||
@import '../../styles/mixins.scss'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
seems to be redundant
</div> | ||
<Popup | ||
contentClassName={b()} | ||
anchorRef={anchorRef || anchor} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we allow to pass anchorRef
? Won't it break behaviour set by us?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We allow to pass anchorRef for custom anchors if they are needed
if anchorRef is not passed - default anchor from component is used
const onPopupMouseEnter = React.useCallback(() => { | ||
setIsPopupContentHovered(true); | ||
}, []); | ||
|
||
const onPopupMouseLeave = React.useCallback(() => { | ||
setIsPopupContentHovered(false); | ||
}, []); | ||
|
||
const onPopupContextMenu = React.useCallback(() => { | ||
setIsFocused(true); | ||
}, []); | ||
|
||
const onPopupBlur = React.useCallback(() => { | ||
setIsFocused(false); | ||
}, []); | ||
|
||
const onPopupEscapeKeyDown = React.useCallback(() => { | ||
setIsFocused(false); | ||
setIsPopupContentHovered(false); | ||
hidePopup(); | ||
}, [hidePopup]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we really need all these useCallback
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes
because we pass this function as prop to external component which may use this function as prop
Closes #1452
Stand
Problem:
Screen.Recording.2024-10-11.at.13.58.58.mov
CI Results
Test Status:⚠️ FLAKY
📊 Full Report
Bundle Size: 🔺
Current: 78.96 MB | Main: 78.95 MB
Diff: +0.00 MB (0.01%)
ℹ️ CI Information