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

remove role=switch on switches #1152

Closed
3 tasks done
Aniort opened this issue Mar 15, 2022 · 3 comments
Closed
3 tasks done

remove role=switch on switches #1152

Aniort opened this issue Mar 15, 2022 · 3 comments

Comments

@Aniort
Copy link
Contributor

Aniort commented Mar 15, 2022

Prerequisites

Describe the issue

on https://boosted.orange.com/docs/5.1/forms/checks-radios/#switches page, we need to remove the role=switch on these switches because role=switch needs to be used with an aria-check attribute
So to be more robust and to ensure more progressive enhancement, just remove the role=switch
references: https://adrianroselli.com/2019/03/under-engineered-toggles.html and https://adrianroselli.com/2021/10/switch-role-support.html

Reduced test cases

https://adrianroselli.com/2021/10/switch-role-support.html

What operating system(s) are you seeing the problem on?

Windows

What browser(s) are you seeing the problem on?

Firefox

What version of Boosted are you using?

5.1.

@Aniort Aniort added the bug label Mar 15, 2022
@MewenLeHo MewenLeHo self-assigned this Mar 15, 2022
MewenLeHo added a commit that referenced this issue Mar 15, 2022
@MewenLeHo MewenLeHo added this to To do in Sprint 8 - March 2022 via automation Mar 15, 2022
@MewenLeHo MewenLeHo moved this from To do to In review in Sprint 8 - March 2022 Mar 15, 2022
@louismaximepiton
Copy link
Member

Hi @Aniort,

This change was provided by Bootstrap with some interesting discussions about it here.

TLDR :

  • The role=switch have been approved in Bootstrap following the advices of w3c recommendations :
input type=checkbox role=checkbox Roles: menuitemcheckbox, option or switch; button if used with aria-pressed. Authors SHOULD NOT use the aria-checked attribute on input type=checkbox elements. Otherwise, any global aria-* attributes and any aria-* attributes applicable to the allowed roles. Note The HTML checked attribute can be used instead of the aria-checked attribute for menuitemcheckbox, option or switch roles when used on type=checkbox.

They also based their opinion on MDN first link, MDN second link and on w3c recommendations. To summarize, role=switch should be added to each switch but <input> have a checked="" attribute that has its own semantic and that's why <input> don't need aria-checked attribute.

What do you think about it ? Do we need to keep these changes ?

@MewenLeHo
Copy link
Contributor

According to @Aniort , the aria-checked attribute is not needed in a switch which is in a input type="checkbox" so we can keep Bootstrap's version.

Sprint 8 - March 2022 automation moved this from In review to Done Mar 23, 2022
@Aniort
Copy link
Contributor Author

Aniort commented Mar 23, 2022

after futher more readings, we can close this PR because Bootstrap has made a good choice for the switches, so let's resume like that !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants