Skip to content

fix: handle skipped view transition ready rejection - #4044

Open
manwithacat wants to merge 1 commit into
bigskysoftware:four-devfrom
manwithacat:fix/view-transition-ready-rejection
Open

fix: handle skipped view transition ready rejection#4044
manwithacat wants to merge 1 commit into
bigskysoftware:four-devfrom
manwithacat:fix/view-transition-ready-rejection

Conversation

@manwithacat

@manwithacat manwithacat commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

Description

document.startViewTransition().ready rejects when the document is hidden. htmx only awaited .finished, so a skipped transition still completed the swap but emitted unhandledrejection (InvalidStateError).

Corresponding issue: #3989

Demo: https://manwithacat.github.io/htmx/demos/view-transition-hidden/

Testing

New unit test mocks startViewTransition with a rejecting ready and asserts no unhandledrejection.

Local npm test (Chromium, same as CI htmx_tests): 87 files, 1739 passed, 0 failed, 5 skipped.

Checklist

  • I have read the contribution guidelines
  • I have targeted this PR against four-dev
  • This is a bugfix
  • Full browser suite — CI; new swap unit test covers the ready-rejection path

document.startViewTransition().ready rejects when the document is hidden.
Catching only .finished left an unhandledrejection even though the swap
still completed.

Closes bigskysoftware#3989
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant