fix(files): Fix checkbox state semantics#42949
Conversation
| const label = this.isNoneSelected || this.isSomeSelected | ||
| ? this.t('files', 'Select all') | ||
| : this.t('files', 'Unselect all') | ||
| const label = t('files', 'Toggle selection for all files and folders') |
There was a problem hiding this comment.
Aren't we loosing context here ?
There was a problem hiding this comment.
I guess not because it will be announced like checkbox - checked - Toggle selection for all files and folders or checkbox - unchecked - Toggle selection for all files and folders
There was a problem hiding this comment.
Accessibility best practices suggest not doubling information that is already available e.g. a popup menu label should not say "Close menu" when opened or "Open menu" when closed when the state is already communicated with aria-expanded
emoral435
left a comment
There was a problem hiding this comment.
After reading through the issue title change, I agree with the choice of using the wording 'Toggle', etc. instead of select/deselect and using the other native accessibility tools to aid the user. This LGTM!
|
I will say though, on a side-note: the value for the input label isnt being shown on the DOM. I could be wrong, and there could be a different way telling us which checkboxes are input, but isn't this also an a11y issue we should work on? Outside of the aria-label, are there any other native tools that let the user know they checked the box? |
|
Thanks for the review @emoral435!
Don't know where it is in Firefox devtools but in Chrome you can see checked state in the Properties tab or just access the el.checked property in the console edit: From MDN "A boolean attribute indicating whether this checkbox is checked by default (when the page loads). It does not indicate whether this checkbox is currently checked: if the checkbox's state is changed, this content attribute does not reflect the change. (Only the HTMLInputElement's checked IDL attribute is updated.)" -https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/checkbox#checked |
|
No problem, @Pytal! Thank you for the MDN reference! Your PR is still great, just wanted to bring up the topic because I'm not all too familiar with this, but I checked this on Chrome and I see the checked property! Sweet :) |
Signed-off-by: Christopher Ng <chrng8@gmail.com>
54ceff8 to
1b0eb2b
Compare
|
/compile |
Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com>
|
/backport to stable28 |

For [BITV]: adapt
aria-label's text for checkboxes in files list #42683Needs fix(NcCheckboxRadioSwitch): Fix invalid indeterminate checkbox semantics nextcloud-libraries/nextcloud-vue#5096
Summary
inputstatesChecklist