Skip to content

Fix AnimatedThemeToggler crash on Firefox (View Transitions API fallback)#879

Merged
Yeom-JinHo merged 3 commits intomagicuidesign:mainfrom
DhirajTsx:fix/animated-theme-toggler-firefox
Mar 3, 2026
Merged

Fix AnimatedThemeToggler crash on Firefox (View Transitions API fallback)#879
Yeom-JinHo merged 3 commits intomagicuidesign:mainfrom
DhirajTsx:fix/animated-theme-toggler-firefox

Conversation

@DhirajTsx
Copy link
Contributor

Firefox compatibility fix for AnimatedThemeToggler

Problem

Firefox does not support the View Transitions API (document.startViewTransition),
which causes the Animated Theme Toggler to throw a runtime error and stop working.

Solution

This PR adds safe feature detection and a graceful fallback:

  • Uses the animated transition when startViewTransition is available
  • Falls back to an instant theme toggle on unsupported browsers (e.g. Firefox)
  • Prevents crashes while preserving functionality

Result

  • Chrome and supported browsers keep the animation
  • Firefox and other unsupported browsers work without errors
  • Improved cross-browser reliability

@vercel
Copy link

vercel bot commented Jan 17, 2026

@DhirajTsx is attempting to deploy a commit to the product-studio Team on Vercel.

A member of the Team first needs to authorize it.

@Yeom-JinHo Yeom-JinHo force-pushed the fix/animated-theme-toggler-firefox branch from 6e50afe to 495cc57 Compare March 3, 2026 12:45
Copy link
Member

@Yeom-JinHo Yeom-JinHo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@DhirajTsx
Thank you for your contribution.
There are some unnecessary files and minor edits, so I’ll merge after rebasing.

@Yeom-JinHo Yeom-JinHo linked an issue Mar 3, 2026 that may be closed by this pull request
2 tasks
@Yeom-JinHo Yeom-JinHo merged commit 3929c8c into magicuidesign:main Mar 3, 2026
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[bug]: /docs/components/animated-theme-toggler

2 participants