-
Notifications
You must be signed in to change notification settings - Fork 533
Better accessibility labels - to master #201
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 - to master #201
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
- Cleave - DataTimePicker - GoogleAddress - Label - Masked - Select - Spectrum - Switch Don't output labels for the following input types: - button - image - submit - reset
@dflock Thank you. Nice PR! Could you add test for |
Added some tests for the getFieldID function - and tightened up it's slugification. - Tests that values are correctly slugified - Tests that schema properties are returned in the expected order of preference
Was trying to add a test to |
I should probably update the docs, too. How do I submit a pull request for this page? |
For describe("check fieldTypeHasLabel function", () => {
before( () => {
createFormGenerator({ fields: [] }, {});
});
it("should return true", () => {
expect(vm.fieldTypeHasLabel({ type: "input", inputType: "checkbox"})).to.be.true;
expect(vm.fieldTypeHasLabel({ type: "input", inputType: "text"})).to.be.true;
});
it("should return false", () => {
expect(vm.fieldTypeHasLabel({ type: "input", inputType: "button"})).to.be.false;
expect(vm.fieldTypeHasLabel({ type: "checklist" })).to.be.false;
});
});
To update docs, you need to register on gitbook and send me your username. |
Test not yet working, commiting to share.
That (and variants) are basically what I tried - but I couldn't figure out how to actually call the
So maybe the If I add a
which does include I've added the code for this test to the branch so you can try it out if you like. |
Also, my gitbooks username is |
I was wrong becase describe("check fieldTypeHasLabel function", () => {
let form;
before( () => {
createFormGenerator({ fields: [] }, {});
form = vm.$refs.form;
});
it("should return true", () => {
expect(form.fieldTypeHasLabel({ type: "input", inputType: "checkbox"})).to.be.true;
expect(form.fieldTypeHasLabel({ type: "input", inputType: "text"})).to.be.true;
expect(form.fieldTypeHasLabel({ type: "checklist" })).to.be.true;
});
it("should return false", () => {
expect(form.fieldTypeHasLabel({ type: "input", inputType: "button"})).to.be.false;
expect(form.fieldTypeHasLabel({ type: "input", inputType: "image"})).to.be.false;
expect(form.fieldTypeHasLabel({ type: "input", inputType: "submit"})).to.be.false;
expect(form.fieldTypeHasLabel({ type: "input", inputType: "reset"})).to.be.false;
});
}); |
Thanks! Test fixed and pushed. Will work on docs now. |
OK, docs changes here: https://www.gitbook.com/book/icebob/vueformgenerator/changes/5 |
Thank you. Nice PR! Merged. |
Same as #105, but onto the master branch, instead of the old next branch.