openstax / os-webview

:books: Front-end web application for the OpenStax web site
28 stars 3 forks source link

Make menus keyboard operable #2520

Closed RoyEJohnson closed 7 months ago

RoyEJohnson commented 8 months ago

For: https://github.com/openstax/openstax.org/issues/2385

Dantemss commented 7 months ago

@TomWoodward the menu doesn't really follow the spec. Probably up to you or Erika to decide how closely we need to follow it?

On desktop:

On mobile:

Dantemss commented 7 months ago

One interesting thing on mobile though is that the menu is no longer horizontal, it's all vertical, so I'm not sure the left/right arrows make as much sense.

RoyEJohnson commented 7 months ago

Note the comment where I point out that I removed the menubar roles and went with the (simpler) Disclosure pattern instead. The link there says most sites don't need the full features of the menubar. Intended navigation is tab, but I added arrows to allow moving between main menu items. I should make the arrow behavior sensible in all contexts.

Dantemss commented 7 months ago

OK I think most of what I said still applies, except the arrows are supposed to do different things from what I said in the disclosure pattern. I'll re-test the tabbing though since that wasn't in the other one.

Dantemss commented 7 months ago

Tabbing seems to work as expected in both Desktop and mobile. And the disclosure pattern doesn't need to do anything when you type a letter (no search by the first letter of the labels).

RoyEJohnson commented 7 months ago

I have made some adjustments so behavior is more coherent: Mobile menu is tab-navigated only. Arrows and Home/End keys are intercepted and tossed. As I understand it, arrows are optional in the Disclosure pattern.

Dantemss commented 7 months ago

Also the desktop version is not quite disclosure pattern because of the auto-open on hover/focus but that is acceptable I think?

Dantemss commented 7 months ago

Maybe that's not a thing? How do screen readers work on mobile anyway?

Dantemss commented 7 months ago

I suppose it would be helpful if you somehow had a tiny screen reader screen.

RoyEJohnson commented 7 months ago

I think the assumption is that you can hook up an external keyboard to a mobile device.

TomWoodward commented 7 months ago

or you might just have a tiny screen like a netbook or have it really zoomed in or something