@klodd/ds 3.10.4 → 3.10.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/js/turbo-nav.js +7 -0
- package/package.json +1 -1
package/js/turbo-nav.js
CHANGED
|
@@ -291,6 +291,13 @@
|
|
|
291
291
|
const guardedSwap = () => { swapDone = true; swap(); };
|
|
292
292
|
try {
|
|
293
293
|
const transition = document.startViewTransition( guardedSwap );
|
|
294
|
+
// Silence rejections on all three transition promises
|
|
295
|
+
// (ready, updateCallbackDone, finished). InvalidStateError
|
|
296
|
+
// can fire on any of them when browser VT-state goes bad.
|
|
297
|
+
// Without this, unhandled rejections show as console
|
|
298
|
+
// exceptions even though navigation otherwise works.
|
|
299
|
+
[ transition.ready, transition.updateCallbackDone, transition.finished ]
|
|
300
|
+
.forEach( ( p ) => p.catch( () => {} ) );
|
|
294
301
|
try { await transition.finished; } catch ( _ ) { /* ignore */ }
|
|
295
302
|
} catch ( _ ) {
|
|
296
303
|
// startViewTransition() threw synchronously (e.g. InvalidStateError).
|