Skip to content
This repository was archived by the owner on Apr 17, 2022. It is now read-only.

Commit 60f5f73

Browse files
committed
fix: Text input not working in monthPicker and timePicker modes (#89)
1 parent 185bc8e commit 60f5f73

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

src/Vue3DatePicker/Vue3DatePicker.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,7 @@
273273
provide('autoApply', props.autoApply);
274274
const formatLocaleRef = computed(() => props.formatLocale);
275275
provide('formatLocale', formatLocaleRef);
276+
provide('textInput', toRef(props, 'textInput'));
276277
277278
onMounted(() => {
278279
parseExternalModelValue(props.modelValue);

src/Vue3DatePicker/components/SelectionGrid.vue

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@
6161
const selectionActiveRef = ref(null);
6262
const gridWrapRef = ref(null);
6363
const autoApply = inject('autoApply', false);
64+
const textInput = inject('textInput', ref(false));
6465
6566
onBeforeUpdate(() => {
6667
selectionActiveRef.value = null;
@@ -73,7 +74,9 @@
7374
setScrollPosition();
7475
const elm = unrefElement(gridWrapRef);
7576
if (elm) {
76-
elm.focus();
77+
if (!textInput.value) {
78+
elm.focus();
79+
}
7780
scrollable.value = elm.clientHeight < elm.scrollHeight;
7881
}
7982
});

0 commit comments

Comments
 (0)