From 7bcb57b89e3f416f15d33611aacc0ea955a21611 Mon Sep 17 00:00:00 2001 From: Ben Olson Date: Mon, 13 Nov 2023 17:40:04 -0800 Subject: [PATCH] Resolve a11y for tag options buttons (#2787) * resolve TagAddButton a11y better comments to document tagindex reasoning * resolved a11y for TagsSelectedButton allow focus to TagsSelectedButton with Shift+Tab and Enter or Space to show popover * safely ignore a11y warning as container for interactables is not itself interactable * Update CONTRIBUTORS * quick fix syntax * quick fix syntax * quick fix syntax * quick fix syntax * resolved a11y in accordance with ARIA APG Disclure pattern * resolved a11y ideally should replace with with a11y-click-events-have-key-events is explicitly ignored as the alternative (adding ) seems more clunky * resolved SpinBox a11y cannot focus on these buttons, so no key event handling needed (keyboard editting already possible by just typing in the field) widget already properly follows ARIA APG Spinbutton pattern * cleanup * onEnterOrSpace() function implemented as discussed in #2787 and #2564 * quick syntax and such changes --- CONTRIBUTORS | 1 + ts/change-notetype/Alert.svelte | 10 +++++++++- ts/components/SpinBox.svelte | 4 ++++ ts/lib/keys.ts | 11 +++++++++++ ts/tag-editor/TagSpacer.svelte | 4 +++- ts/tag-editor/tag-options-button/TagAddButton.svelte | 5 ++++- .../tag-options-button/TagOptionsButton.svelte | 1 + .../tag-options-button/TagsSelectedButton.svelte | 12 ++++++++++-- 8 files changed, 43 insertions(+), 5 deletions(-) diff --git a/CONTRIBUTORS b/CONTRIBUTORS index e0043bd5f..2c889920f 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -148,6 +148,7 @@ user1823 <92206575+user1823@users.noreply.github.com> Gustaf Carefall virinci snowtimeglass +Ben Olson ******************** diff --git a/ts/change-notetype/Alert.svelte b/ts/change-notetype/Alert.svelte index a3ce9e305..79406785e 100644 --- a/ts/change-notetype/Alert.svelte +++ b/ts/change-notetype/Alert.svelte @@ -4,6 +4,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html --> - + + +
+
-
(show = !show)}> +
(show = !show)} + on:keydown={onEnterOrSpace(() => (show = !show))} + > {@html dotsIcon}
@@ -50,8 +58,8 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html