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
Sometimes Transition
renders child instanly
#5193
Comments
Sandbox link is not working |
@ghana7989 thanks, I fixed the link. |
I think that's the same issue as #3126. |
Please have a look at this comment where I've provided an example using a patched version of the library. Could you please check whether this resolves the issue for you? |
Fixed in 7.6.1 |
It's still happening in the stories on the Mantine website, FYI :) |
@rtivital Still happening for the modals manager example on the Mantine website. Modal opens instantly after several attempts. |
What package has an issue
@mantine/core
Describe the bug
Sometimes
Transition
renders child instanly without actually transitioning, this happens whenTransition
status is currentlyexited
and then itsmounted
prop value changes fromfalse
totrue
.Here is the code to reproduce the problem:
https://codesandbox.io/p/devbox/mantine-transition-test-next-4dfvdc
Here is the screen recording. I toggle
isVisible
boolean value by clicking the first button.isVisible
is used as the value ofmounted
Transition
prop. After a few toggles the hidden button appears instantly.toggling.mp4
Simulation of fast toggling:
interval.mp4
I'm not sure why exactly this happens. I tried experimenting with
flushSync
inside thehandleStateChange
function here, but without success.https://github.com/mantinedev/mantine/blob/master/src/mantine-core/src/components/Transition/use-transition.ts#L41
What version of @mantine/* packages do you have in package.json? (Note that all @mantine/* packages must have the same version in order to work correctly)
7.1.7
If possible, please include a link to a codesandbox with the reproduced problem
https://codesandbox.io/p/devbox/mantine-transition-test-next-4dfvdc
Do you know how to fix the issue
No
Are you willing to participate in fixing this issue and create a pull request with the fix
None
Possible fix
No response
The text was updated successfully, but these errors were encountered: