Skip to content
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

menu-button: add a css selector to the Menu to know when it's open #28

Closed
bogdansoare opened this issue Aug 31, 2018 · 3 comments
Closed

Comments

@bogdansoare
Copy link

My use case is that I want to style an arrow icon inside the MenuButton based on whether the menu is open or not.

Is this a feature that could be accepted? Can I make a pull request?

@bogdansoare
Copy link
Author

or maybe I should use the aria-expanded attribute?

@chadwithuhc
Copy link

[aria-expanded="true"] will accomplish same thing fo sho

@ryanflorence
Copy link
Member

^ that works, will also be adding a render prop API here because we can't animate the exit transition yet.

It'll probably look like this:

<Menu>
  {({ isOpen }) => (
    <MenuButton/>
    {isOpen && <MenuList/>}
  )}
</Menu>

Not only will it allow animations, but you'd be able to add whatever classNames you wanted when it's open.

jakierice pushed a commit to jakierice/reach-ui that referenced this issue Jan 4, 2019
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

No branches or pull requests

3 participants