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

Range picker with autoApply breaks upon clearing input from keyboard #98

Closed
nekitk opened this issue Feb 11, 2022 · 1 comment
Closed
Labels
bug Something isn't working
Milestone

Comments

@nekitk
Copy link

nekitk commented Feb 11, 2022

Describe the bug
When trying to clear text input of Datepicker in range mode with autoApply set to true, page breaks with error:

Cannot read properties of null (reading 'length')

To Reproduce
Steps to reproduce the behavior:

  1. Go to https://codesandbox.io/s/vue3-date-time-picker-demo-forked-c7ter?file=/src/components/Demo.vue
    Or create new component elsewhere with this set of props:
    <Datepicker v-model="date" range text-input auto-apply />
  2. Using keyboard delete all the text from date input (e.g. press Tab and then Backspace/Delete)

Expected behavior
Input should become empty and value should be set to null.
It works that way when autoApply is set to false or when Datepicker is in single date mode.
Clearing input by clicking on 'x' also works without any problem

Screenshots

Video: https://user-images.githubusercontent.com/7345182/153621929-4a5fb0ea-e78a-4703-8597-c6a7ec8510d4.mp4

image

Desktop (please complete the following information):

  • OS: macOS 12.2
  • Browser Chrome
  • Version 98
@nekitk
Copy link
Author

nekitk commented Feb 11, 2022

Tried different versions in sandbox and it seems like it has broken in version 2.3.6
Version 2.3.5 doesn't break upon clearing input.

@Jasenkoo Jasenkoo added the bug Something isn't working label Feb 11, 2022
@Jasenkoo Jasenkoo added this to the v2.6.0 milestone Feb 11, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants