Description
We're seeing an issue when auto-apply is enabled with min-date & max-date and the user add/edit an existing date via keyboard input (Backspace).
After further investigation we were able to reproduce the same behavior using VueDatePicker.
Version : @vuepic/vue-datepicker v12.1.0
To Reproduce
<template>
<VueDatePicker
v-model="date"
auto-apply
:min-date="minDate"
:max-date="maxDate"
:year-range="[minYr, maxYr]"
:text-input="{
format: 'dd/MM/yyyy',
maskFormat: 'DD/MM/YYYY',
applyOnBlur: true
}"
:time-config="{
'enableTimePicker': false
}"
/>
</template>
<script setup>
import { ref } from 'vue'
import { VueDatePicker } from '@vuepic/vue-datepicker'
import '@vuepic/vue-datepicker/dist/main.css'
const minYr = 2013
const maxYr = 3026
const minDate = new Date(minYr, 0, 1)
const maxDate = new Date()
maxDate.setFullYear(maxYr)
const date = ref(minDate)
</script>
Steps
- Focus the input.
- Press Backspace to delete year.
- Press Backspace to delete one or more digits.
- It will get stuck at
/ backslash.
Changing minYr to 2027 will resolve bug.
Expected
The input should remain editable and allow to delete / while the user is modifying the date.
Example:
01/01/2013
↓ Backspace
01/01/201_
↓ Backspace
01/01/20__
↓ Backspace
01/01/2___
↓ Backspace
01/01/____
↓ Backspace
01/01_____
Desktop & mobile:
Additional Notes
- Disabling
auto-apply makes Backspace/manual editing work as expected.
- This appears to be related to the interaction between
auto-apply and text-input config.
Description
We're seeing an issue when
auto-applyis enabled withmin-date&max-dateand the user add/edit an existing date via keyboard input (Backspace).After further investigation we were able to reproduce the same behavior using
VueDatePicker.Version :
@vuepic/vue-datepickerv12.1.0To Reproduce
Steps
/backslash.Expected
The input should remain editable and allow to delete
/while the user is modifying the date.Example:
Desktop & mobile:
Additional Notes
auto-applymakes Backspace/manual editing work as expected.auto-applyand text-input config.