-
Notifications
You must be signed in to change notification settings - Fork 532
Better accessibility labels #105
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
Better accessibility labels #105
Conversation
* Associate each label with it's control, by making sure that each control has an id, and using the labels `for` attribute to bind to this. * Don't output label elements for button controls
Thanks, I will check it. Could you fix eslint errors? |
OK, eslint errors fixed, sorry about that - I normally use standard, so didn't run eslint 😊 |
No problem, thanks for fixing :) |
Just to be clear, this is merge-able, but not complete - not all inputs done and form level id prefix not done. Let me know what you think after testing and I'll update & complete. |
I need more time, because I'm ill. 🤒 |
- Cleave - DataTimePicker - GoogleAddress - Label - Masked - Select - Spectrum - Switch Don't output labels for the following input types: - button - image - submit - reset
Hope you feel better soon! In the meantime, I've pushed support for a few more input types. |
Thanks! Great commit! |
@dflock I checked commits. My suggestion is that, abstractField has reference to the computed: {
fieldID() {
// Try to get a reasonable default id from the this.schema,
// then slugify it.
if (typeof this.schema.id !== "undefined") {
// If an ID's been explicitly set, use it unchanged
return this.schema.id;
} else {
return (this.schema.inputName || this.schema.label || this.schema.model)
.toString()
.trim()
.toLowerCase()
// Spaces to dashes
.replace(/ /g, "-")
// Multiple dashes to one
.replace(/-{2,}/g, "-")
// Remove leading & trailing dashes
.replace(/^-+|-+$/g, "")
// Remove anything that isn't a (English/ASCII) letter or number.
.replace(/([^a-zA-Z0-9\._-]+)/g, "")
;
}
}
} |
Sorry, I've been up to my eyeballs lately and haven't had a chance to finish this off. I found some time to try your suggestion and it seemed to work OK in the components and Anyway, I'll try to get back to this as soon as I can - I'd really like to get this merged at some point - I haven't forgotten about it! |
Thanks. |
I'm back working on this again - sorry for the delay! OK, I've pulled this branch up to date with current master. Can you re-open this pull request, or do you want me to start a new one? |
Hi, I can't reopen because base branch (next) is deleted. You need to fork from |
Starts to fix #74:
control has an id, and using the labels
for
attribute to bindto this.
I tried to keep the change set minimal, but some trailing white-space got removed.