-
Notifications
You must be signed in to change notification settings - Fork 194
fix: popup menu story caused has more submenus open #572
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 menu story caused has more submenus open #572
Conversation
Added logic to remove mxPopupMenu,mxWidow and mxTooltip classes before each render. This should not impact the functionality since graph initialization inside story will add them afterwards.
19cf4d6
to
73de056
Compare
# Conflicts: # packages/html/.storybook/preview.ts
WalkthroughThe changes introduce a new function, Changes
Assessment against linked issues
The changes effectively address the issue of persistent UI elements by removing the specified elements during the story rendering process, which should prevent context menus from remaining visible when switching between Storybook stories or demo pages. 📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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.
LGTM
Tested with the following stories
For the popup menu feature:
- Events
- MenuStyle
For the MaxWindow feature:
- JsonData
- UserObject
Added logic to remove mxPopupMenu,mxWidow and mxTooltip classes before each render. This should not impact the functionality since graph initialization inside story will add them afterwards.
PR Checklist
maxGraph
, and you are assigned to the issue.packages/core/_tests_
or a new or altered Storybook story inpackages/html/stories
(an existing story may also demonstrate the change).Overview
Reason for this PR is issue #400. Basically Popups and Windows would stick when navigating from one story to another. Reason for this is lack of cleaning up the graph and properly destroying its resources while story is unmounting.
I found no ways in storybook to call something on story unmount but since we instatiate graph when running each story, we can remove the classes before running any story by selecting all elements that have specific mx class and removing them from DOM.
This is how issue looked before:
before.mov
After this change:
popup-after.mov
Also works properly with mxWindow inside Window story.
This probably fixes #400
Summary by CodeRabbit