-
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
[@mantine/core] next try fixing transition issues #5873
[@mantine/core] next try fixing transition issues #5873
Conversation
71ab7e9
to
40db9b6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work @cyantree! I can no longer reproduce the issue.
I'm curious why the changes to modal tests were necessary?
I think that's because at first the component is unmounted and therefore the state is This is because with my changes the state transition from So setting However I'm happy for any suggestions as this (at least for me) is a finicky bug. |
I can also confirm it solves the problem on my end, thanks so much! |
Thanks everyone for validation! @cyantree, thanks for the fix! |
This change was made quite some time ago but hopefully someone can help with an issue i'm facing which is preventing me from upgrading past 7.6.1. I've found that since this change was introduced, any code that incorporates I've been able to isolate it to the moving of It's worth noting that due to issues with js-dom being flakey with I'm currently looking into whether this is something I can work around within vitest / react testing library etc but I suspect i'm not the only person to face this and maybe someone else has figured it out? UPDATE: As usual, asking for help generally helps one solve their own problem :-) For anyone else coming across this, i've found that combining the |
(Hopefully) fixes #3126 #5193 #5849.
As I found out earlier it's probably related to the automatic batching in React. Therefore this fix uses
flushSync()
to enforce the state update at the right moment.I hope that this will fix the issue.