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

fix: Close context menu on item click in Chip component #263

Merged
merged 1 commit into from
Apr 24, 2019

Conversation

neeilya
Copy link
Contributor

@neeilya neeilya commented Apr 17, 2019

Fixes DHIS2-6611.

Problem
Context menu doesn't close after mouse click on "Manage axes" menu item.

Clicking on other menu items ("Move to category", "Move to filter" and "Remove") "closes" menu, but under the hood it just removes chip & menu entirely, therefore the problem was unnoticeable before introducing "Manage axes" menu item.

Solution
Close menu programmatically after mouse click on menu item.

Implementation
Since we generate menu items in DefaultAxis component and pass them as props to Chip which renders Menu - we don't have control over Menu in DefaultAxis component.

To solve this without changing current architecture we can use React built-in cloneElement function and assign one more onClick callback function to menu items which closes the menu.

@neeilya neeilya merged commit 1322191 into master Apr 24, 2019
@neeilya neeilya deleted the fix/chip-contextmenu-close branch April 24, 2019 13:47
neeilya added a commit that referenced this pull request Apr 24, 2019
@dhis2-bot
Copy link
Contributor

🎉 This PR is included in version 33.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@dhis2-bot
Copy link
Contributor

🎉 This PR is included in version 33.1.13 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

None yet

3 participants