-
Notifications
You must be signed in to change notification settings - Fork 6.3k
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
Tweak language toggler #2566
Tweak language toggler #2566
Conversation
@moshfeu please try this branch. Live preview: https://affectionate-almeida-a9f620.netlify.com/en/ It might need some further styling tweaks, but I think it's a big improvement already. In order for ESC to close the menu, well need more JS to handle this, but let's leave it for later. /CC @nodejs/website (not sure if I can CC you guys, probably not) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking very good to me.
If they will take that PR (I hope so), it will worth to keep improve this component.
Maybe I should wrap the |
* reduce the IDs usage * reduce data attributes * use classes * keyboard navigation works now
It's very opinion based but I spoke with accessibility expert some time ago and he actually didn't recommended to use The code also says something like that. Navigation will keep a record in the history, while the code replace the record: nodejs.org/layouts/partials/header.hbs Line 61 in 2026c6a
|
That's something that needs to change BTW, see #2541. |
Anyway, I'll freeze the changes for now so that this can be reviewed. I also dropped one data attribute and used |
I'm not sure :) But let's see what they will decide.. |
@nodejs/website Reviews? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @XhmikosR,
I understand that you want to simplify the code but I think that these chnages aren't necessary, they are simple by nature ...
Please try and understand the changes. This makes the language toggler way more accessible and keyboard navigateable. |
@3imed-jaberi try to switch a language without the mouse, only keyboard. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For accessibility 👍
Looks good to me |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great 💯
A minor regression from #2566
Fixes #2545