diff --git a/.changeset/light-hounds-complain.md b/.changeset/light-hounds-complain.md new file mode 100644 index 000000000000..89570b43fa8d --- /dev/null +++ b/.changeset/light-hounds-complain.md @@ -0,0 +1,5 @@ +--- +'svelte': patch +--- + +fix: improve a11y-click-events-have-key-events message diff --git a/documentation/docs/05-misc/02-accessibility-warnings.md b/documentation/docs/05-misc/02-accessibility-warnings.md index ba718ebe7352..45c9d2fbc40d 100644 --- a/documentation/docs/05-misc/02-accessibility-warnings.md +++ b/documentation/docs/05-misc/02-accessibility-warnings.md @@ -52,16 +52,18 @@ Enforce that `autofocus` is not used on elements. Autofocusing elements can caus ## `a11y-click-events-have-key-events` -Enforce `on:click` is accompanied by at least one of the following: `on:keyup`, `on:keydown`, `on:keypress`. Coding for the keyboard is important for users with physical disabilities who cannot use a mouse, AT compatibility, and screenreader users. +Enforce that visible, non-interactive elements with an `on:click` event are accompanied by a keyboard event handler. -This does not apply for interactive or hidden elements. +Users should first consider whether an interactive element might be more appropriate such as a `