Skip to content

Conversation

@sarahboyce
Copy link
Contributor

Fixes #1955

Note that I removed the titles as I don't believe they are worth it

Copy link
Contributor

@SaptakS SaptakS left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't tested the styling, but left some comments on the markup. Let me know if you have any thoughts.

@sarahboyce sarahboyce force-pushed the language-switcher-accessibility branch from 74b62df to 61c8772 Compare November 24, 2025 14:18
@sarahboyce
Copy link
Contributor Author

Lovely suggestions thank you! I've tried to incorporate each of them 👍

@thibaudcolas thibaudcolas moved this from New to To Review in django accessibility improvements Dec 4, 2025
display: inline-block;
}
&:hover li.other,
&:focus-within li.other {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think instead of using focus-within and removing .open usage in SCSS, it might be better to leave it the other way (i.e. use &.open li.other to actually show the other languages, instead of &:focus-within li.other).

My reasoning for this is, with &.open, the language options are shown on button press, whereas with focus-within, it shows as soon as the button is focused. I think the button press UX is better in keyboard, than automatically showing on focus, because with automatic showing with focus-within user will have to tab through all the languages and all the documentation version to reach the "top of the page" button. But with button press, the language and documentation versions only show if enter pressed, and otherwise can be easily tabbed through.

Thoughts?

This is how the interaction looks to me with .open
https://github.com/user-attachments/assets/7b616c81-2bf0-4fa9-8af8-4415816c20f2

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is a nicer keyboard UX as well 👍 pushed a tweak

@sarahboyce sarahboyce force-pushed the language-switcher-accessibility branch from 61c8772 to c5cdfb1 Compare December 5, 2025 13:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: To Review

Development

Successfully merging this pull request may close these issues.

The language and docs version switcher is impossible to use with a keyboard

2 participants