react-tailwindcss-datepicker icon indicating copy to clipboard operation
react-tailwindcss-datepicker copied to clipboard

When typing in a date, UI of the component does not update, but onChange is triggered.

Open vanta240i opened this issue 2 years ago • 6 comments

When typing in a date, and not selecting it, the date gets formatted and selected, and it also triggers the onChange event. This all works great, however, the menu that is meant for selecting dates still shows the previous date, and does not update with the typed date.

https://github.com/onesine/react-tailwindcss-datepicker/assets/102895212/d999d527-f3a2-416c-8fa4-3605206bea3d

The onChange() event is also triggered image

The only issue being that the UI still shows Jun 13, 2023 for example, even after putting a date from september 2020. image

vanta240i avatar Jun 13 '23 14:06 vanta240i

Hi 👋 @generic-glitch

Thanks for the feedback.

We will take a look at it very soon.

onesine avatar Jun 13 '23 15:06 onesine

Thank you so much!

I'll try to figure out more as to why this happens myself if I have time, and possibly come to a solution.

vanta240i avatar Jun 13 '23 15:06 vanta240i

I have just released a new version which should solve the problem. Can you try and close this issue if it's ok.

onesine avatar Jun 13 '23 18:06 onesine

Could I see what props you gave to the Datepicker element?

For me it still happens

https://github.com/onesine/react-tailwindcss-datepicker/assets/102895212/cab3dcae-284e-4fb5-86ad-202ea8e9fe43

And I updated react-tailwindcss-datepicker to: image (I tried npm update, uninstalling and reinstalling, etc)

This is my code for the datepicker as well: image

vanta240i avatar Jun 13 '23 19:06 vanta240i

I've also noticed that there's still the problem. There seems to be something I'm missing. The local test passes though.

onesine avatar Jun 13 '23 20:06 onesine

I've also noticed that there's still the problem. There seems to be something I'm missing. The local test passes though.

I think since the onChange event still gets executed, the fix should probably just be some code added in the onChange event to just set the date/update the state of the actual UI of the component.

vanta240i avatar Jun 15 '23 04:06 vanta240i