This repository was archived by the owner on Apr 17, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed
Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change 3636 <slot :name =" slot" v-bind =" args" />
3737 </template >
3838 </DatepickerInput >
39+ <span tabindex =" -1" ref =" focusRef" ></span >
3940 <teleport :to =" teleport" :disabled =" inline" v-if =" isOpen" >
4041 <DatepickerMenu
4142 v-if =" isOpen"
148149 const modelValueMap = toRef (props , ' modelValue' );
149150 const dpMenuRef = ref (null );
150151 const inputRef = ref (null );
152+ const focusRef = ref <HTMLElement | null >(null );
151153 provide (' autoApply' , props .autoApply );
152154 const formatLocaleRef = computed (() => props .formatLocale );
153155 provide (' formatLocale' , formatLocaleRef );
387389 if (inputRef .value ) {
388390 (inputRef .value as { unFocus: () => void }).unFocus ();
389391 }
392+ setSoftFocus ();
390393 }
391394 };
392395
408411 }
409412 };
410413
414+ // When menu is close, allows user interaction via keyboard down the DOM tree, focus the span el after dp
415+ const setSoftFocus = (): void => {
416+ if (focusRef .value ) {
417+ focusRef .value .focus ({ preventScroll: true });
418+ }
419+ };
420+
411421 onClickOutside (dpMenuRef , inputRef , closeMenu );
412422
413423 defineExpose ({
You can’t perform that action at this time.
0 commit comments