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

Switch loses animation when calling toggleColorScheme #5092

Closed
kirankunigiri opened this issue Oct 21, 2023 · 1 comment
Closed

Switch loses animation when calling toggleColorScheme #5092

kirankunigiri opened this issue Oct 21, 2023 · 1 comment
Labels
Fixed patch Completed issues that will be published with next patch (1.0.X)

Comments

@kirankunigiri
Copy link

What package has an issue

@mantine/core

Describe the bug

I wanted to create a component that is able to toggle the color scheme with a Switch component. A standard Switch that I copied from the docs has a nice toggling animation. However, when setting onChange to run the toggleColorScheme function (from the docs, see sandbox), the Switch toggle animation does not run and it instantly changes.

toggleBug.mov

Note: I'm using 7.1.5 in my own project, but in the sandbox (which uses 7.1.3) the bug also appears.

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.5

If possible, please include a link to a codesandbox with the reproduced problem

https://codesandbox.io/s/sharp-dawn-k54q7k

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

@rtivital rtivital added the Fixed patch Completed issues that will be published with next patch (1.0.X) label Oct 22, 2023
rtivital added a commit that referenced this issue Oct 22, 2023
rtivital added a commit that referenced this issue Oct 22, 2023
@rtivital
Copy link
Member

Fixed in 7.1.6, you can now pass the option to keep transitions to useMantineColorScheme({ keepTransitions: true })

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Fixed patch Completed issues that will be published with next patch (1.0.X)
Projects
None yet
Development

No branches or pull requests

2 participants