Compare commits

...

1 Commits

Author SHA1 Message Date
Cory LaViska
a4a257f8e7 adds a hard coded delay to drastically reduce theme picker jank 2025-03-24 16:40:17 -04:00

View File

@@ -4,9 +4,12 @@ export function domChange(fn, { behavior = 'smooth' } = {}) {
document.startViewTransition && !window.matchMedia('(prefers-reduced-motion: reduce)').matches;
if (canUseViewTransitions && behavior === 'smooth') {
document.startViewTransition(fn);
} else {
fn(true);
const transition = document.startViewTransition(() => {
fn(true);
// Wait a brief delay before finishing the transition to prevent jumpiness
return new Promise(resolve => setTimeout(resolve, 200));
});
return transition;
}
}