Skip to content
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

[popover2] fix(ContextMenu2): disable native menu correctly with content function API #6227

Merged
merged 2 commits into from
Jun 20, 2023

Conversation

adidahiya
Copy link
Contributor

Fixes #6225

Checklist

  • Includes tests
  • Update documentation

Changes proposed in this pull request:

Fix implementation of ContextMenu2's "contextmenu" event handler to behave correctly when content is specified as a render prop.

Previously, the event handler was referencing outdated state for the menu content and incorrectly assuming that the user returned an undefined menu (a typical usage pattern in user code when contentProps.mouseEvent === undefined).

Now, we make sure to run the props.content() render function again in the event handler to make sure we have the latest rendered menu content.

Reviewers should focus on:

No regressions in ContextMenu2; completeness of unit tests.

Screenshot

2023-06-20 11 44 21

@adidahiya
Copy link
Contributor Author

[popover2] fix(ContextMenu2): disable native menu correctly with content function API

Build artifact links for this commit: documentation | landing | table | demo

This is an automated comment from the deploy-preview CircleCI job.

@adidahiya
Copy link
Contributor Author

Add more unit tests

Build artifact links for this commit: documentation | landing | table | demo

This is an automated comment from the deploy-preview CircleCI job.

@adidahiya adidahiya merged commit 2a64fe7 into develop Jun 20, 2023
@adidahiya adidahiya deleted the ad/fix-context-menu-native-trigger branch June 20, 2023 16:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Table context menu no longer suppresses browser native menu
1 participant