-
Notifications
You must be signed in to change notification settings - Fork 1.2k
RAC: Submenu support #5648
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
RAC: Submenu support #5648
Conversation
Build successful! 🎉 |
Build successful! 🎉 |
Build successful! 🎉 |
Build successful! 🎉 |
fixes hover event handling (events bubble through portals)
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.
Provisional approval for the code changes, will wait for the new build to test it fully. Will do a full approval after than, pulling it out of the main page example/starter example can be followup
Build successful! 🎉 |
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, lets get this in for some final testing
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.
approving for testing but let's discuss this one comment
|
||
export const MenuContext = createContext<ContextValue<MenuProps<any>, HTMLDivElement>>(null); | ||
export const MenuStateContext = createContext<TreeState<unknown> | null>(null); | ||
export const RootMenuTriggerStateContext = createContext<RootMenuTriggerState | null>(null); | ||
export const SubmenuContext = createContext<{popoverContainerRef: RefObject<Element>} | null>(null); |
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.
Do we need to create a separate SubmenuContext for this, or could we have Menu provide PopoverContext with UNSTABLE_portalContainer directly?
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.
That should work. We'll get a reading refs during render lint warning, but I guess we can ignore.
Build successful! 🎉 |
## API Changes
unknown top level export { type: 'any' } @react-aria/menuAriaSubmenuTriggerProps AriaSubmenuTriggerProps {
+ delay?: number = 200
isDisabled?: boolean
node: RSNode<unknown>
parentMenuRef: RefObject<HTMLElement>
submenuRef: RefObject<HTMLElement>
}
it changed:
|
Discussion here: #5648 (comment)
Implements submenus in RAC via the SubmenuTrigger component.
✅ Pull Request Checklist:
📝 Test Instructions:
Test new stories and docs.
🧢 Your Project:
RSP