Reach-ui: add "trigger":hover|click props on menubutton

Created on 20 Sep 2019  路  6Comments  路  Source: reach/reach-ui

add "trigger":hover|click props on menubutton

Enhancement

Most helpful comment

Hmm, if you read: https://ui.reach.tech/menu-button, you can see it references https://www.w3.org/TR/wai-aria-practices-1.1/examples/menu-button/menu-button-links.html where the example shows us the menu button opens up when hovered in stead of clicked.

So if the lib tries to follow the wai-aria practices it should be changed to onHover in stead of onClick?

All 6 comments

I'm not sure what you are asking here @rumsky. Can you provide an example and the reasoning behind the use-case?

If you'd like to have something like the example below, it should already work, if not it's a bug imo.

 <Button onClick={bla} onHover={blaFocus}>Focus Me</Button>

I'm not sure what you are asking here @rumsky. Can you provide an example and the reasoning behind the use-case?

If you'd like to have something like the example below, it should already work, if not it's a bug imo.

 <Button onClick={bla} onHover={blaFocus}>Focus Me</Button>

I mean, add a prop like :'trigger', to specify menu open by "click" or "hover".
Currently only provides a way to click.

Hii can i take this ?

Hmm, if you read: https://ui.reach.tech/menu-button, you can see it references https://www.w3.org/TR/wai-aria-practices-1.1/examples/menu-button/menu-button-links.html where the example shows us the menu button opens up when hovered in stead of clicked.

So if the lib tries to follow the wai-aria practices it should be changed to onHover in stead of onClick?

like antd dropdown there is a prop:trigger,the trigger mode which executes the drop-down action
https://ant.design/components/dropdown/

We are not looking to add a trigger prop like the one in Ant Design, though there's a somewhat related issue here about a way to control the menu button state. Not sure yet where we'll land on it, but I'd follow that issue for updates. https://github.com/reach/reach-ui/issues/350

Was this page helpful?
0 / 5 - 0 ratings