You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The above knobs can be very effective, but might also require expertise to get right.
89
+
Specifically, the `addRestoreCallback` mechanism can be easily overlooked by developers and cause bad UX when BFCache is enable and the state is not cleaned up properly.
89
90
90
-
The likely use case to let an animation continue till the end, so we can perhaps enable this declaratively:
91
+
As an alternative, proposing a declarative CSS-based solution, based on view-transition at rules and `@navigation` conditionals:
91
92
92
93
```css
93
-
::view-transition-group {
94
-
animation-navigation-behavior: smooth;
94
+
@navigation(preview) {
95
+
#skeleton {
96
+
display: block;
97
+
}
98
+
}
99
+
100
+
@view-transition {
101
+
navigation: preview;
102
+
types: some-preview-types;
95
103
}
96
104
```
97
105
106
+
The "preview" animation with its attached types would start when the navigation is initiated (but not intercepted), and would defer the commit until
107
+
it is finished. The "new" state of the animation would be controlled by style only, using the `@navigation(preview)` conditional (which can be mixed and matches with other conditionals).
108
+
98
109
## Pros and cons of the different solutions
99
110
100
111
While deferring page swap provides full flexibility, it also needs care to avoid some footguns that can cause unwanted navigation delays.
0 commit comments