DateInput flickers the wrong date when used with timezones.
Dependencies check up
- [X] I have verified that I use latest version of all @mantine/* packages
What version of @mantine/* packages do you have in package.json?
7.10.1
What package has an issue?
@mantine/dates
What framework do you use?
Next.js
In which browsers you can reproduce the issue?
Chrome
Describe the bug
When using DateInput as a controlled input and using a timezone, the displayed date will flicker to your localized time before switching to the timezone provided. The time value is correct and does not change, merely the displayed date.
I was able to reproduce this in a sandbox and in my local mantine storybook.
If possible, include a link to a codesandbox with a minimal reproduction
https://codesandbox.io/p/sandbox/dateinput-timezone-issue-ywwqtq?file=%2Fsrc%2FApp.tsx
Possible fix
Not 100% sure. One way would be to set the input to use the provided timezone, or prevent it from changing the provided value.
Self-service
- [X] I would be willing to implement a fix for this issue
You are welcome to research the issue and send a PR with the fix.
Hello @rtivital! I opened a PR with fix. Ready for review.