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

Fix #4170: Clear the previously selected date on empty input with showTimeSelectOnly #7

Conversation

balajis-qb
Copy link
Collaborator

@balajis-qb balajis-qb commented Oct 23, 2023

Closes Hacker0x01#4170

Summary

This PR addresses an issue where the DatePicker was not clearing the previously selected time when the user deletes the value in the date input via keyboard. This issue was only coming when the showTimeSelectOnly is enabled.

Changes Made:

  • I updated the new date value only if the value exist, else set the null value, instead of restoring back to the previously selected value
  • I added test cases to validate the above case both with and without showTimeSelectOnly using React Test Library

…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 balajis-qb merged commit 6ff581d into main Nov 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

DatePicker with "showTimeSelectOnly" is not possible clear the value
1 participant