Skip to content

DatePicker with "showTimeSelectOnly" is not possible clear the value #4170

@MarcoB89

Description

@MarcoB89

Describe the bug
When the datepicker is configured with property "showTimeSelectOnly" it's not possible to clear the value

To Reproduce
Steps to reproduce the behavior:

  1. Go to the page 'https://reactdatepicker.com/' and find the "Select Time Only" example (https://reactdatepicker.com/#example-select-time-only)
  2. Click on the datepicker
  3. Clear the value in the input (backspace or delete on the keyboard)
  4. Click outside
  5. The previous value reappears in the input

Expected behavior
The datepicker should be cleared, withuout value

Screenshots
Step 1
immagine
Step 2
immagine
Step 3 and 4
immagine

Desktop (please complete the following information):

  • OS: Windows 10
  • Browser Chrome
  • Version 115.0.5790.102 (Official Build) (64-bit)
  • Version ReactDatepicker 4.16

Additional context
I tryed in a previous versione of react-datepicker (4.8.0) and it worked, so i think is a regression

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions