UniversalViewer / universalviewer

A community-developed open source project on a mission to help you share your 📚📜📰📽️📻🗿 with the 🌎
http://universalviewer.io
Other
495 stars 191 forks source link

Gallery icon label issue when using screen reader #1186

Open cbaksik opened 6 days ago

cbaksik commented 6 days ago

UV version:

 universalviewer@v3.1.4

I'm submitting a:

Current behavior: When using a screen reader the gallery icon reads as "gallery" no matter what view is being used (full view versus gallery view). For example, if you are in full view, the gallery icon has label "gallery. When you are in gallery view the gallergy icon label is still "gallery" even though you are already in the gallery and using the button in this state will close the glallery.

Expected behavior: When the gallery view is open, there should be a different label associated with the icon to mean "full view" instead of "gallery."

Steps to reproduce: In full view, click on the gallery icon. While in gallery view, the label of the icon is "gallery" even though you are already in gallery view.

Other information: I made a screen recording to demo specifically the icon in question. I narrate how the label does not change in the tooltip (same problem for screen reader): https://harvard.zoom.us/rec/share/UbI26dutHZpsloLIAYVhUjuxzxsBtTBUmQZrsC2XwLHdnXCm8yp9OBoJvEopEwqG.Mut5womckBc9dONU?startTime=1728056803000

demiankatz commented 6 days ago

Thanks, @cbaksik. I'm not sure it would be entirely clear to have the Gallery icon label change to "Full View" when the Gallery is open, because I think it might be confusing in relation to the adjacent "Single page view" / "Two page view" icons. The Gallery really operates independently of those other controls as a toggle.

I'd suggest one of two possible approaches:

1.) Have the Gallery icon label switch between "Open Gallery view" and "Close Gallery view"

2.) Change the Gallery icon label to "Toggle Gallery view" (possibly with a parenthetical indicator or some other aria attributes to indicate the current state of the gallery)

What do you think?

cbaksik commented 6 days ago

Thanks for your quick response. Option 1 sounds perfect, and better than what I suggested :-)