From 0f84e7c6955f6ce0ea9ce184650fc13deff1bd88 Mon Sep 17 00:00:00 2001 From: Maksim Nedoshev Date: Thu, 22 Jun 2023 12:00:42 +0300 Subject: [PATCH 1/8] fix(ui): select, date-input, time-input keyboard navigation --- packages/ui/src/components/va-date-input/VaDateInput.vue | 3 ++- packages/ui/src/components/va-select/VaSelect.vue | 7 ++++++- packages/ui/src/components/va-time-input/VaTimeInput.vue | 4 ++-- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/packages/ui/src/components/va-date-input/VaDateInput.vue b/packages/ui/src/components/va-date-input/VaDateInput.vue index fc29b66a95..18c15da1be 100644 --- a/packages/ui/src/components/va-date-input/VaDateInput.vue +++ b/packages/ui/src/components/va-date-input/VaDateInput.vue @@ -133,7 +133,7 @@ import { VaIcon } from '../va-icon' const VaInputWrapperProps = extractComponentProps(VaInputWrapper, ['focused', 'maxLength', 'counterValue']) const VaDatePickerProps = extractComponentProps(VaDatePicker) const VaDropdownProps = extractComponentProps(VaDropdown, - ['innerAnchorSelector', 'stateful', 'keyboardNavigation', 'modelValue'], + ['innerAnchorSelector', 'stateful', 'keyboardNavigation', 'modelValue', 'trigger'], ) export default defineComponent({ @@ -404,6 +404,7 @@ export default defineComponent({ closeOnAnchorClick: false, keyboardNavigation: true, innerAnchorSelector: '.va-input-wrapper__field', + trigger: 'none' as const, })) return { diff --git a/packages/ui/src/components/va-select/VaSelect.vue b/packages/ui/src/components/va-select/VaSelect.vue index 78d0d39781..312f6f2afe 100644 --- a/packages/ui/src/components/va-select/VaSelect.vue +++ b/packages/ui/src/components/va-select/VaSelect.vue @@ -15,6 +15,8 @@ @focus="onInputFocus" @blur="onInputBlur" @click="focusAutocompleteInput" + @keydown.enter="toggleDropdown" + @keydown.space.stop.prevent="toggleDropdown" >