From c4e3a91b5ceb96159a1975c1d8c8731b5ee32804 Mon Sep 17 00:00:00 2001 From: The Jared Wilcurt Date: Mon, 22 Aug 2022 11:27:29 -0400 Subject: [PATCH] (fix) allow keyboard scrolling when a scrollbar is applied to the element (#33) Default to `tabindex="0"` on the internal `` element to allow keyboard scrolling when a scrollbar is applied to the element. This resolves an accessibility issue found by Vue-Axe. --- CHANGELOG.md | 4 ++++ src/vue.ts | 1 + 2 files changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7835ae4..c3e1d4b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## 2.1.2 + +- Default to `tabindex="0"` on the internal `` element to allow keyboard scrolling when a scrollbar is applied to the element. This resolves an accessibility issue found by Vue-Axe. (#33) + ## 2.1.1 - add `exports "."` to `package.json` (#27) diff --git a/src/vue.ts b/src/vue.ts index 991d3b9..2358af4 100644 --- a/src/vue.ts +++ b/src/vue.ts @@ -68,6 +68,7 @@ const component = defineComponent({ h('code', { class: this.className, innerHTML: this.highlightedCode, + tabindex: '0', }), ]) },