-
Notifications
You must be signed in to change notification settings - Fork 19
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(context menu): Fix for context menu use when zoomed out #249
Conversation
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.
Awesome work on the context menu fix, @jeff-phillips-18 ! Looks great. Wondering if it might be worth applying this fix to the Styles -> Labels demos as well, just to keep the hover behavior consistent across the board. What are your thoughts?
@@ -118,6 +118,8 @@ interface DefaultNodeProps { | |||
onContextMenu?: (e: React.MouseEvent) => void; | |||
/** Flag indicating that the context menu for the node is currently open */ | |||
contextMenuOpen?: boolean; | |||
/** Flag indicating the label should move to the top layer when the node is hovered */ | |||
raiseLabelOnHover?: boolean; |
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.
Could we add a TODO here as a reminder to remove this in the next breaking change release. WDYT @jeff-phillips-18 ?
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 could change it to default to false
but we need to know if the application is already putting the node on the TOP_LAYER or not.
90c9c61
to
7187c6e
Compare
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.
Thanks for making these fixes @jeff-phillips-18 , hover works great in the updated demos 🎉
Just noticed when the context menu is accessed / clicked from the Context Menu Labels demo , the node icon is no longer visible :
7187c6e
to
85b75f7
Compare
@jenny-s51 Fixed. Thanks. |
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.
Thanks @jeff-phillips-18 , latest changes look great! LGTM 🚀
Released in v5.4.1 |
What
Closes #247
Description
Adds the option to not raise the label when the node is hovered. This keeps the label on the same layer as the node which avoids getting a mouse leave event when moving from the node to the label. For applications that are raising the node to the TOP_LEVEL on hover, they should pass
raiseLabelOnHover={false}
to theDefaultNode
.Also, when the context menu is open, treat the node label the same as if hovering so that it remains visible and un-truncated while the context menu is open.
Type of change
Screen shots / Gifs for design review