feat: create TooltipMenuTriggerCombo component#758
Closed
dominiccarrington wants to merge 4 commits intomomentum-design:masterfrom
Closed
feat: create TooltipMenuTriggerCombo component#758dominiccarrington wants to merge 4 commits intomomentum-design:masterfrom
dominiccarrington wants to merge 4 commits intomomentum-design:masterfrom
Conversation
…splay name to MenuTrigger fixes keyboard not firing the onOpenChange prop
Collaborator
Author
|
Closed in favour of the versions coming from momentum-design |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR fixes 2 issues related to MenuTrigger:
react-aria functionality doesn't fire when the trigger component is activated by the keyboard. This is causes the onOpenChange callback to not fire and a11y props (such as aria-expanded) to not update on the trigger component.
This PR makes the react-aria useMenuTriggerState control if the menu is open or not and makes the Popover trigger manually when the useMenuTriggerState.isOpen is updated. (like the Select component)
This causes a small breaking change if you are using Tooltips as the triggerComponent since tippy doesn't add the click event handler to the button anymore.
Additionally MenuTrigger doesn't provide all the props to the trigger component when using a Tooltip that it does normally when a button is provided directly. (for example aria-controls) This is because the properties don't get merged onto the Button but instead the Popover created by the Tooltip.
This PR creates a TooltipMenuTriggerCombo component, similar to TooltipPopoverCombo, which handles capturing the props given to the MenuTrigger triggerComponent and passes them to the button component instead.
Links
https://jira-eng-gpk2.cisco.com/jira/browse/SPARK-615094
https://jira-eng-gpk2.cisco.com/jira/browse/SPARK-616381