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

Desktop: Accessibility: Make keyboard focus visible for dropdowns #11177

Conversation

personalizedrefrigerator
Copy link
Collaborator

@personalizedrefrigerator personalizedrefrigerator commented Oct 5, 2024

Summary

This pull request makes keyboard focus visible when settings <select>s have focus. Previously, these elements had the same appearance when unfocused as when focused.

Related to #10795, WCAG §2.4.7 (see F87).

Notes:

  • This currently uses --joplin-border-color3 when :focus-visible.
  • For selects, :focus-visible is true after clicking (not just when navigating with the keyboard).

Screenshots

Settings

Before:
screenshot: Light theme select boxes, all have the same border

After:
screenshot: Light theme select boxes, the last has an orange border

Revision viewer

After:
screenshot: Orange outline around the revision viewer history dropdown

Important

This style is applied using :focus-visible. Because these are <select>s, this style is applied after selecting an item, even without a keyboard.

@laurent22
Copy link
Owner

I wonder if the contrast is sufficient for this? What would be WCAG guideline for this?

@personalizedrefrigerator
Copy link
Collaborator Author

I wonder if the contrast is sufficient for this? What would be WCAG guideline for this?

I've changed the color to be consistent with the other focus indicators. The WCAG's Understanding Focus Appearance (SC 2.4.13) discusses the appearance of focus indicators (though is a level AAA guideline and we're currently targeting level AA). With the updated indicator:

Currently, however, it's the same size as the other focus indicators (a larger size with border styling would cause a layout change). It may make sense to adjust the border width of the focus indicators all at once.

This shows the focus indicator for <select>s not in settings: The
<select> in the revision history page and the dropdown in the share
dialog.
@personalizedrefrigerator personalizedrefrigerator changed the title Desktop: Accessibility: Make keyboard focus visible for settings dropdowns Desktop: Accessibility: Make keyboard focus visible for dropdowns Oct 12, 2024
@laurent22 laurent22 merged commit 6afa2d1 into laurent22:dev Oct 15, 2024
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants