A08

Warning

Accessibility

A08 — A dialog with no title

A Modal, Dialog, AlertDialog or Sheet with no title: (a Sheet may take a label:), which is its accessible name.

What the compiler said

warning[A08]: Modal missing "title" attribute --> src/App.wf:4:5 | 4 | Modal(visible: open) { Text("Hello") } | ^^^^^ = help: Add a title: Modal(visible: state, title: "Dialog Title") = docs: https://webfluent.monzeromer.dev/errors/A08

Your editor offers this fix: Add title: "Open". wf fix --code A08 applies it to every place it fits.

The fix

Broken

wf

page P(path: "/", title: "T", description: "D") { state open = false Heading("Modal").h1 Modal(visible: open) { Text("Hello") } }

Fixed

wf

page P(path: "/", title: "T", description: "D") { state open = false Heading("Modal").h1 Modal(visible: open, title: "Hello") { Text("Hello") } }

Modal(visible: open, title: "Delete this?") — the title is its accessible name.

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": { "A08": "off" } // wf-allow(A08)