-
Notifications
You must be signed in to change notification settings - Fork 0
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
Added DropdownMenu #24
Conversation
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.
Would you mind adding a ladle story for this? Not sure if you've done one yet, you can see some examples in the repo, they are named *.stories.tsx
and you can run the local preview server with yarn ladle serve
b97edb7
to
2e45971
Compare
also the keyboard navigation doesn't follow the example we discussed https://www.w3.org/WAI/ARIA/apg/patterns/menu-button/examples/menu-button-links/ |
Thanks for reminding me... most of the keyboard navigation is no good... I'll look into implementing these |
OK I believe I added all the keyboard navigation stuff from that link. Let me know if you see that I missed something. |
|
||
return <> | ||
<DropdownMenu id='enabled-grades-menu' state={enabledState} text='Sync/Export Grades' variant='primary'> | ||
<DropdownMenuItemButton onClick={onClick} state={enabledState}> |
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.
If the MenuItemButtons should always have the same state as their enclosing DropdownMenus, you should consider making that a Context.
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.
I'll give that a try
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.
if you do as roy suggests you can also move the useDropdownMenu
call and state provider into the dropdown menu component, removing the burden of managing that from the consumer call
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.
Added the context provider and removed export for useDropdownMenu
…d while using the dropdown menus
For: https://github.com/openstax/unified/issues/2727
A dropdown menu activated by a button with a caret. I'm using it for actions, not navigation, so I made the items buttons instead of links.