Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
MarcoB89 opened this issue Jul 22, 2023 · 2 comments · Fixed by qburst/react-datepicker-3#7, #4336 or jones58/personal-knowledge-wiki#29 · May be fixed by rowidanagah/EduMentorMate#9
Assignees

Comments

@MarcoB89
Copy link

MarcoB89 commented Jul 22, 2023

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

@balajis-qb
Copy link

Hi @martijnrusschen,

I found the reason behind this issue. Can you please assign this issue to me? I'll work on it

balajis-qb pushed a commit to qburst/react-datepicker-3 that referenced this issue Oct 23, 2023
…electOnly

Previously, the selected date was not being cleared and retained the previously selected time when an empty value was passed to the date input while showTimeSelectOnly was enabled due to a bug.  This commit address the issue and adds test cases to ensure proper functionality.

Closes Hacker0x01#4170
@balajis-qb
Copy link

Hi @martijnrusschen ,

I added a fix for the issue - #4336. Kindly review my PR and let me know if any changes required. Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment