Skip to content

Commit 03a07e0

Browse files
committed
Fix view transitions
1 parent 3642431 commit 03a07e0

3 files changed

Lines changed: 4 additions & 4 deletions

File tree

src/webflo-runtime/webflo-client/WebfloClient.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -566,11 +566,11 @@ export class WebfloClient extends AppRuntime {
566566
Observer.set(this.transition, 'rel', viewTransitionRel);
567567
// Trigger transition
568568
if (document.startViewTransition && this.withViewTransitions && !detail.hasUAVisualTransition) {
569-
const synthesizeWhile = window.webqit?.realdom?.synthesizeWhile || ((callback) => callback());
569+
const synthesizeWhile = /*window.webqit?.realdom?.synthesizeWhile ||*/ ((callback) => callback());
570570
return new Promise(async (resolve) => {
571571
await synthesizeWhile(async () => {
572572
Observer.set(this.transition, 'phase', 'old');
573-
const viewTransition = document.startViewTransition({ update: updateCallback, styles: ['navigation', viewTransitionRel] });
573+
const viewTransition = document.startViewTransition({ update: updateCallback, types: ['navigation', viewTransitionRel] });
574574
try { await viewTransition.updateCallbackDone; } catch (e) { console.log(e); }
575575
Observer.set(this.transition, 'phase', 'new');
576576
try { await viewTransition.ready; } catch (e) { console.log(e); }

src/webflo-runtime/webflo-client/WebfloRootClientA.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export class WebfloRootClientA extends WebfloClient {
3434
#hmr;
3535

3636
get withViewTransitions() {
37-
return document.querySelector('meta[name="webflo:viewtransitions"]')?.value;
37+
return ['true', '1', 'yes'].includes(document.querySelector('meta[name="webflo:viewtransitions"]')?.content?.toLowerCase());
3838
}
3939

4040
constructor(bootstrap, host) {

src/webflo-runtime/webflo-client/WebfloSubClient.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export class WebfloSubClient extends WebfloClient {
2020

2121
get viewport() { return this.#superRuntime.viewport; }
2222

23-
get withViewTransitions() { return this.host.hasAttribute('viewtransitions'); }
23+
get withViewTransitions() { return ['true', '1', 'yes'].includes(this.host.getAttribute('viewtransitions')?.toLowerCase()); }
2424

2525
constructor(superRuntime, host) {
2626
if (!(superRuntime instanceof WebfloClient)) {

0 commit comments

Comments
 (0)