Skip to content

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

Merged
merged 81 commits into from
Feb 5, 2024
Merged

RAC: Submenu support #5648

merged 81 commits into from
Feb 5, 2024

Conversation

reidbarber
Copy link
Member

@reidbarber reidbarber commented Jan 3, 2024

Implements submenus in RAC via the SubmenuTrigger component.

✅ Pull Request Checklist:

  • Included link to corresponding React Spectrum GitHub Issue.
  • Added/updated unit tests and storybook for this change (for new code or code which already has tests).
  • Filled out test instructions.
  • Updated documentation (if it already exists for this component).
  • Looked at the Accessibility Practices for this feature - Aria Practices

📝 Test Instructions:

Test new stories and docs.

🧢 Your Project:

RSP

@reidbarber reidbarber changed the title [WIP] RAC: Submenu support RAC: Submenu support Jan 11, 2024
@reidbarber reidbarber marked this pull request as ready for review January 11, 2024 21:22
@rspbot
Copy link

rspbot commented Jan 11, 2024

@adobe adobe deleted a comment from rspbot Jan 11, 2024
@rspbot
Copy link

rspbot commented Jan 12, 2024

@rspbot
Copy link

rspbot commented Jan 31, 2024

@rspbot
Copy link

rspbot commented Jan 31, 2024

devongovett and others added 2 commits January 31, 2024 23:59
fixes hover event handling (events bubble through portals)
@adobe adobe deleted a comment from rspbot Feb 1, 2024
Copy link
Member

@LFDanLu LFDanLu left a 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

@rspbot
Copy link

rspbot commented Feb 2, 2024

@adobe adobe deleted a comment from rspbot Feb 2, 2024
Copy link
Member

@LFDanLu LFDanLu left a 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

Copy link
Member

@devongovett devongovett left a 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);
Copy link
Member

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?

Copy link
Member Author

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.

@rspbot
Copy link

rspbot commented Feb 5, 2024

@rspbot
Copy link

rspbot commented Feb 5, 2024

## API Changes

unknown top level export { type: 'any' }
unknown top level export { type: 'any' }
unknown top level export { type: 'any' }
unknown top level export { type: 'any' }
unknown top level export { type: 'any', access: 'private' }
unknown top level export { type: 'any', access: 'private' }
unknown top level export { type: 'any' }
unknown top level export { type: 'any' }
unknown top level export { type: 'any' }
unknown top level export { type: 'any' }
unknown top level export { type: 'identifier', name: 'Column' }
unknown top level export { type: 'identifier', name: 'Column' }
unknown type { type: 'link' }
unknown type { type: 'link' }
unknown type { type: 'link' }
unknown type { type: 'link' }
unknown type { type: 'link' }
unknown type { type: 'link' }
unknown top level export { type: 'any' }
unknown top level export { type: 'any' }
unknown top level export { type: 'any' }
unknown top level export { type: 'any' }
unknown top level export { type: 'any' }
unknown top level export { type: 'any' }

@react-aria/menu

AriaSubmenuTriggerProps

 AriaSubmenuTriggerProps {
+  delay?: number = 200
   isDisabled?: boolean
   node: RSNode<unknown>
   parentMenuRef: RefObject<HTMLElement>
   submenuRef: RefObject<HTMLElement>
 }
 

it changed:

  • UNSTABLE_useSubmenuTrigger

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.

6 participants