Skip to content

Commit

Permalink
Fix ViewTransition regression
Browse files Browse the repository at this point in the history
  • Loading branch information
imacrayon committed Nov 15, 2024
1 parent 7b2eeee commit fde1778
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,7 @@ async function send(control, action = '', method = 'GET', body = null, enctype =
function createTargets(plan, controller) {
let decorate = (el) => {
el._ajax_strategy = el._ajax_strategy || settings.mergeStrategy
el._ajax_transition = el.__ajax_transition && document.startViewTransition
el._ajax_transition = el._ajax_transition && document.startViewTransition
el._ajax_abort && el._ajax_abort()
el.querySelectorAll('[aria-busy]').forEach((busy) => {
busy._ajax_abort && busy._ajax_abort()
Expand Down Expand Up @@ -525,8 +525,9 @@ async function merge(target, to) {

let transition = document.startViewTransition(() => {
target = strategies[target._ajax_strategy](target, to)
return Promise.resolve()
})
await transition.ready
await transition.updateCallbackDone

return target
}
Expand Down

0 comments on commit fde1778

Please sign in to comment.