salesforce / design-system-react

Salesforce Lightning Design System for React
https://design-system-react-site.herokuapp.com/
BSD 3-Clause "New" or "Revised" License
918 stars 416 forks source link

Datepicker cannot be cleared when onChange callback is defined #3100

Closed chuyler closed 1 year ago

chuyler commented 1 year ago

If you define a parser and onChange handler similar to demo example, the user is unable to set the date input back to empty by clicking and removing the content.

After investigation, it is because the parser passes back an empty string '' instead of Date and date-picker.jsx is trying to call date.getTimezoneOffset().

chuyler commented 1 year ago

Figured out how to pass invalid date to avoid error.