[POC] Render MenuItem as li > button#85
[POC] Render MenuItem as li > button#85miroslavstastny wants to merge 1 commit intofeat/menu-iconsfrom
Conversation
| children | ||
| ) : ( | ||
| <a | ||
| <button |
There was a problem hiding this comment.
Tested with the change as button and now it works as expected for each case.
Space and Enter trigger onclick method.
Tested with:
Chrome > JAWS with and without virtual cursor
Edge > Narrator when scan mode is on/off
Firefox > NVDA > when browse mode is on/off
OSX > Chrome > VoiceOver > without and with VoiceOver keys
There was a problem hiding this comment.
Today we have been testing more using "a" tag for menu and figure out following:
When added on menu "a" handleKeydown method:
handleKeydown = e => {
if (e.which === 32 || e.which === 13) {
this.handleClick(e)
// _.invoke(this.props, 'onClick', e, this.props)
e.preventDefault()
}
}
-
Then space/enter was working properly
-
And JAWS was not listed link in link view... What is fine...
So in the end I think we could go with "a" tag in menu.
| {childrenExist(children) ? ( | ||
| children | ||
| ) : ( | ||
| <a |
There was a problem hiding this comment.
Do we really want to replace the a tag with a button? I think that might have its own set of issues. I don't understand the root issue though. Is it that the onclick handler is interfering with the default link?
|
After discussion with @jurokapsiar we decided to stick with |
Menu
!!! DO NOT MERGE !!!
For accessibility reasons, Menu renders as
ul > li > awithonClickhandler ona, see #44.This still does not work as expected, see #61.
This is a Proof of Concept which renders the menu as
ul > li > buttonto test if it helps with the accessibility.There should be no visual regression, however UTs are failing at the moment.
TODO