From 50cdcfa025767a2c26a0ff8eaecac22fee02a72f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tu=C4=9F=C3=A7e=20K=C3=BC=C3=A7=C3=BCko=C4=9Flu?= Date: Wed, 3 Aug 2022 13:09:54 +0300 Subject: [PATCH] Calendar: timeOnly accessibility refactor --- src/components/calendar/Calendar.vue | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/src/components/calendar/Calendar.vue b/src/components/calendar/Calendar.vue index fe6adea9d..a30cdca59 100755 --- a/src/components/calendar/Calendar.vue +++ b/src/components/calendar/Calendar.vue @@ -2249,9 +2249,20 @@ export default { else focusableElements[focusedIndex - 1].focus(); } - else { - if (focusedIndex == -1) - focusableElements[focusableElements.length - 1].focus(); + else {debugger; + if (focusedIndex === -1) { + if (this.timeOnly) { + focusableElements[0].focus(); + } + else { + let spanIndex = null; + for (let i = 0; i < focusableElements.length; i++){ + if (focusableElements[i].tagName === 'SPAN') + spanIndex = i; + } + focusableElements[spanIndex].focus(); + } + } else if (focusedIndex === (focusableElements.length - 1)) focusableElements[0].focus(); else @@ -2358,6 +2369,10 @@ export default { this.overlayVisible = false; break; + case 'Tab': { + console.log('inline') + break; + } default: break; }