GovTechSG / sgds-govtech-react

React components for SGDS
https://react.designsystem.tech.gov.sg/
MIT License
16 stars 6 forks source link

DatePicker's DateInput component not passing date to onChangeDate callback function #253

Closed clye-cog closed 2 months ago

clye-cog commented 2 months ago

Prerequisites

Describe the issue

https://github.com/user-attachments/assets/0c9a3e80-d22a-405b-9164-b7194f613792

What operating system(s) are you seeing the problem on?

macOS

What browser(s) are you seeing the problem on?

Chrome

Describe your frontend stack. What version of React and @govtechsg/sgds-react are you using? CSR or SSR?

React v16. @govtechsg/sgds-react v2.5.1. CSR.

clukhei commented 2 months ago

@clye-cog To keep date change event from mouse click and keyboard input consistent. It will be as follows

mode = "single" Mouse click --> onChangeDate called only after date is selected by mouse click Keyboard input --> onChangeDate called only after a valid date is typed into the input

mode="range" Mouse click --> onChangeDate called only after both start and end date is selected by mouse click Keyboard input --> onChangeDate called only after both valid start and end dates are typed into the input

clye-cog commented 2 months ago

Hi @clukhei , thank you for the reply. Yes I understand. However, even with a valid date, I am not able to trigger the change.

I can trigger a change using the mouse click. But I cannot trigger a change in date when a valid date is typed into the input.

Is there something I'm missing from this? I have attached a video I used in my app.

https://github.com/user-attachments/assets/96681dca-f796-46a6-b1e0-4605410b37a2

clukhei commented 2 months ago

@clye-cog yes, its a bug that we missed out when we implemented the date input. Fix is on the way. Please wait for updates in this thread. will keep you posted when the changes are released.

clye-cog commented 2 months ago

No problem, thanks a lot @clukhei 🙏

clukhei commented 2 months ago

@clye-cog The fix has been released in v2.6.1. Please upgrade @govtechsg/sgds-react to version 2.6.1

https://github.com/GovTechSG/sgds-govtech-react/releases/tag/v2.6.1

clye-cog commented 2 months ago

Thanks @clukhei ! Tested and it works :)