From a36f870508dc331bd63c3ed6cbbf1811ce40af18 Mon Sep 17 00:00:00 2001 From: Ben McCann <322311+benmccann@users.noreply.github.com> Date: Fri, 27 Oct 2023 15:40:52 -0700 Subject: [PATCH 1/7] fix: improve a11y-click-events-have-key-events message --- .changeset/light-hounds-complain.md | 5 +++++ .../src/compiler/compile/compiler_warnings.js | 2 +- .../warnings.json | 14 +++++++------- .../validator/samples/slot-warning/warnings.json | 2 +- .../validator/samples/slot-warning2/warnings.json | 2 +- 5 files changed, 15 insertions(+), 10 deletions(-) create mode 100644 .changeset/light-hounds-complain.md 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/packages/svelte/src/compiler/compile/compiler_warnings.js b/packages/svelte/src/compiler/compile/compiler_warnings.js index c5d7ca8c5a3f..c087f192ecba 100644 --- a/packages/svelte/src/compiler/compile/compiler_warnings.js +++ b/packages/svelte/src/compiler/compile/compiler_warnings.js @@ -271,7 +271,7 @@ export default { a11y_click_events_have_key_events: { code: 'a11y-click-events-have-key-events', message: - 'A11y: visible, non-interactive elements with an on:click event must be accompanied by an on:keydown, on:keyup, or on:keypress event.' + 'A11y: visible, non-interactive elements with an on:click event must be accompanied by a keyboard event handler. Consider whether another element might be more appropriate such as a