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

fix: a11y: keyboard navigation: add outline and focusability #4005

Merged
merged 3 commits into from
Jul 18, 2024

Conversation

WofWca
Copy link
Collaborator

@WofWca WofWca commented Jul 3, 2024

See commit messages

I tested it. Appears to be working good, but some rarely used elements might get ugly even for mouse-only navigation.

This by no means makes DC fully keyboard-accessible, but it's an improvement.

@WofWca WofWca force-pushed the wofwca/keyboard-accessibility branch from 81002a3 to 2034198 Compare July 3, 2024 13:34
@WofWca WofWca added accessibility enhancement New feature or request polish labels Jul 3, 2024
The chat background color picker, with keyboard, from the main screen
This improves keyboard usage experience (accessibility, a11y)

For the most part this does not affect items
that are focused with mouse instead of keyboard
(apart from "advanced" login fields, and maybe some other places),
all thanks to `:focus-visible` selector
https://developer.mozilla.org/en-US/docs/Web/CSS/:focus-visible#focus_vs_focus-visible

Composer, message search, settings, contact search are not affected
for pointer device users.

For reference, here are some commits that had to do with
`outline` and `:focus`.
They don't appear to be paying much attention
to keyboard-accessibility:
- b740c60
- b5fb8a0
- 0c7949c
- 11bda12
- 9307958
@WofWca WofWca force-pushed the wofwca/keyboard-accessibility branch from 2034198 to 4aa5082 Compare July 3, 2024 13:55
@Simon-Laux
Copy link
Member

seems to work though the majority of the app still isn't focusable:

  • accounts in sidebar
  • tabs (qr code scanner dialog, gallery
  • items in gallery
  • Images in messages
  • toggle switches in settings
  • appearance settings, theme selector button and wallpapers

We can also track those in a new issue.

I don't really like the visual style of the outline (orange + white) yet, but maybe I'll get used to it.

also outline should probably have the highest z-index so it is always fully visible:
Bildschirmfoto 2024-07-05 um 00 44 02
(in the settings it's currently cut off)

@r10s
Copy link
Member

r10s commented Jul 5, 2024

is the outline always visible or only after tab is hit?

is there a selector for high-contrast or accessibility maybe? what do others (signal, whatsapp) do here?

@WofWca
Copy link
Collaborator Author

WofWca commented Jul 5, 2024

highest z-index so it is always fully visible

I'm not sure if there is a way to set z-index on the outline, but you can try to set negative outline-offset for such cases. Or adjust the focusable element's size. Or just highlight the item in some other way, e.g. with the background color change.
The way I think about this change is to have accessibility by default for all elements, which can be customized optionally.

is the outline always visible or only after tab is hit?

Only after Tab is hit. It's won't appear if you're just using a mouse.

is there a selector for high-contrast or accessibility maybe?

I believe so.

@WofWca
Copy link
Collaborator Author

WofWca commented Jul 5, 2024

what do others (signal, whatsapp) do here?

Signal appears to behave the same, but they do it programmatically, by dynamically adding .keyboard-mode class.

@Simon-Laux Simon-Laux merged commit 1e86e9e into main Jul 18, 2024
7 checks passed
@Simon-Laux Simon-Laux deleted the wofwca/keyboard-accessibility branch July 18, 2024 16:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants