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

doc: Fix date inputs on Chrome #704

Merged
merged 1 commit into from
Oct 24, 2024
Merged

Conversation

mehm8128
Copy link
Contributor

@mehm8128 mehm8128 commented Oct 24, 2024

I found the issue that on the docs Date inputs don't work well.
https://nuqs.47ng.com/docs/parsers/built-in#dates--timestamps

if we click now button, date successfully filled to the input and demo is working well, but if we it manually selecting the date and time, selected value is not filled.
This is because we can't valueAsDate for the input tag with datetime-local, so I fixed it.

I think this might be the same with the code below, but I don't know how I open the page of it so I can't debug it.
https://github.com/mehm8128/nuqs/blob/fix/docs-date-input/packages/docs/src/app/playground/_demos/parsers/page.tsx#L92-L109

Copy link

vercel bot commented Oct 24, 2024

@mehm8128 is attempting to deploy a commit to the 47ng Team on Vercel.

A member of the Team first needs to authorize it.

Copy link

vercel bot commented Oct 24, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
nuqs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 24, 2024 8:03am

@franky47
Copy link
Member

franky47 commented Oct 24, 2024

That's interesting, it works on my end (Firefox 131), but you have to select the time too (as it's a datetime picker). What browser are you on that doesn't give you valueAsDate?

Screen.Recording.2024-10-24.at.10.00.47.mov

Note: I get the same behaviour with the preview deployment:
https://nuqs-5ysucs2vb-47ng.vercel.app/docs/parsers/built-in#iso-8601

@franky47
Copy link
Member

Don't worry about the playground/_demos, those are parked examples from the old playground that I haven't ported to the new docs, they'll probably go away at some point.

@mehm8128
Copy link
Contributor Author

mehm8128 commented Oct 24, 2024

Thank you, I understand.
I use Chrome 129. I tried to use firefox and I successfully filled as you showed.

This is my record trying to fill date with three methods.

  1. open the calendar and select date and time (on chrome there is also time selector)
    -> can't fill date and time
  2. input date and time (2024/10/24 17:15)
    -> trying to fill minutes, form was reset
  3. click Now button
    -> successfully filled

Please try it on Chrome!

lsWt8lEEMA.mp4

fyi: my record in the preview environment for this PR. I successfully fill date and time

explorer_6oTcRT2iIC.mp4

Copy link
Member

@franky47 franky47 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh wow, good catch, today I learned something. Thanks!

@franky47 franky47 changed the title fix: enable to set date manually on docs doc: Fix date inputs on Chrome Oct 24, 2024
@franky47 franky47 merged commit e4addb4 into 47ng:next Oct 24, 2024
24 checks passed
Copy link

🎉 This PR is included in version 2.0.4 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants