From e2b9df1888775bd5d7349fb81c1e7038942c038c Mon Sep 17 00:00:00 2001 From: Brandon McConnell Date: Thu, 2 Mar 2023 06:38:43 -0500 Subject: [PATCH] docs: update 06-accessibility-warnings.md (#8342) Convert recommended events to use Svelte syntax, and include deprecation warning re https://developer.mozilla.org/en-US/docs/Web/API/Element/keypress_event --- site/content/docs/06-accessibility-warnings.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/site/content/docs/06-accessibility-warnings.md b/site/content/docs/06-accessibility-warnings.md index ee52aab405..4324ed7b75 100644 --- a/site/content/docs/06-accessibility-warnings.md +++ b/site/content/docs/06-accessibility-warnings.md @@ -55,7 +55,7 @@ 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: `onKeyUp`, `onKeyDown`, `onKeyPress`. Coding for the keyboard is important for users with physical disabilities who cannot use a mouse, AT compatibility, and screenreader users. +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. This does not apply for interactive or hidden elements. @@ -64,6 +64,8 @@ This does not apply for interactive or hidden elements.
{}} /> ``` +Note that the `keypress` event is now deprecated, so it is officially recommended to use either the `keyup` or `keydown` event instead, accordingly. + --- ### `a11y-distracting-elements`