A15
Warning
Accessibility
A15 — An aria-label that does not contain the visible text
A control's aria-label does not contain the text it shows, so what a voice-control user says does not match what they see.
What the compiler said
warning[A15]: Button shows "save" but its aria-label says "Submit the form" --> src/App.wf:3:5 | 3 | Button("Save", aria-label: "Submit the form") | ^^^^^^ = help: Start the aria-label with the visible text, so what a user says matches what they see = docs: https://webfluent.monzeromer.dev/errors/A15
Your editor offers this fix: Start it with "Save". wf fix --code A15 applies it to every place it fits.
The fix
Broken
page P(path: "/", title: "T", description: "D") {
Heading("Save").h1
Button("Save", aria-label: "Submit the form")
}
Fixed
page P(path: "/", title: "T", description: "D") {
Heading("Save").h1
Button("Save", aria-label: "Save the form")
}
Start the aria-label with the visible words: aria-label: "Save the draft".
Each example is a whole program: it is all of src/App.wf in a project with no other .wf file (trying an example).
lints may lower it:
"lints": { "A15": "off" }
// wf-allow(A15)