Skip to content

Commit

Permalink
Deduplicate ActionMenu.tsx (#3713)
Browse files Browse the repository at this point in the history
* Deduplicate `ActionMenu.tsx`

* Retrigger actions
  • Loading branch information
iansan5653 authored Sep 7, 2023
1 parent 25693b0 commit d277855
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 142 deletions.
140 changes: 0 additions & 140 deletions src/ActionMenu.tsx

This file was deleted.

9 changes: 7 additions & 2 deletions src/ActionMenu/ActionMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,12 @@ type MenuOverlayProps = Partial<OverlayProps> &
*/
children: React.ReactNode
}
const Overlay: React.FC<React.PropsWithChildren<MenuOverlayProps>> = ({children, align = 'start', ...overlayProps}) => {
const Overlay: React.FC<React.PropsWithChildren<MenuOverlayProps>> = ({
children,
align = 'start',
'aria-labelledby': ariaLabelledby,
...overlayProps
}) => {
// we typecast anchorRef as required instead of optional
// because we know that we're setting it in context in Menu
const {anchorRef, renderAnchor, anchorId, open, onOpen, onClose} = React.useContext(MenuContext) as MandateProps<
Expand Down Expand Up @@ -119,7 +124,7 @@ const Overlay: React.FC<React.PropsWithChildren<MenuOverlayProps>> = ({children,
value={{
container: 'ActionMenu',
listRole: 'menu',
listLabelledBy: anchorId,
listLabelledBy: ariaLabelledby || anchorId,
selectionAttribute: 'aria-checked', // Should this be here?
afterSelect: onClose,
}}
Expand Down

0 comments on commit d277855

Please sign in to comment.