-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
MonthPicker in range mode in controlled form endlessly useEffect calls #7336
Comments
Seems to be a regression from #7278 |
The issue is not related to Mantine. Most likely there is something wrong with your useEffect, but it is difficult to tell without a thorough examination of the code for which I do not have time (sorry). You can see that the controlled state works correctly, the component is rerendered only when the value changes – https://codesandbox.io/p/sandbox/mantine-react-template-forked-tqyhgp |
I still believe it's an issue related to Mantine. I'm sorry for not providing a more minimal reproduction initially. Now I've updated the reproduction. The error only happens, when the MonthPicker is in range-mode and a picking is active: Screencast.From.2025-01-21.12-49-27.mp4 |
It seems to be related to the |
Dependencies check up
What version of @mantine/* packages do you have in package.json?
7.15.3 / 7.16.0 / 7.16.1
What package has an issue?
@mantine/dates
What framework do you use?
Vite
In which browsers you can reproduce the issue?
All
Describe the bug
When using the
<MonthPicker>
in range mode within a controlled formuse-date-state.ts
endlessly callsuseEffect
atmantine/packages/@mantine/dates/src/hooks/use-dates-state/use-dates-state.ts
Lines 169 to 178 in 476b417
The controlled form sets the value of the
<MonthPicker>
to[new Date(), null]
.If possible, include a link to a codesandbox with a minimal reproduction
https://codesandbox.io/p/sandbox/mantine-react-template-forked-qtxcvf
Possible fix
In Version 7.15.1 the issue was not present.
Self-service
The text was updated successfully, but these errors were encountered: