Skip to content

Commit

Permalink
Reenables identification of elements after view transitions.
Browse files Browse the repository at this point in the history
  • Loading branch information
martrapp committed Jul 20, 2024
1 parent 9e076a0 commit 065d488
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
5 changes: 5 additions & 0 deletions .changeset/cuddly-parents-prove.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@vtbag/inspection-chamber': patch
---

Reenables identification of elements after view transitions.
3 changes: 2 additions & 1 deletion src/bench.txt
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,8 @@
/>
<div style="view-transition-name: vtbag-checkbox-styled">
<input id="vtbag-ui-framed" type="checkbox" />
<label for="vtbag-ui-framed">Frame elements</label><br />
<label for="vtbag-ui-framed"
title="Highlight the outline of elements with view&#10;transition names or their pseudo elements&#10;during view transitions.">Frame elements</label><br />
<input id="vtbag-ui-named-only" type="checkbox" />
<label
for="vtbag-ui-named-only"
Expand Down
6 changes: 2 additions & 4 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,10 +130,7 @@ function beforeUpdateCallbackDone() {
viewTransition!.finished.finally(() => {
clearVtActive();
inspectionChamber.viewTransition = undefined;
const twin = top!.__vtbag.inspectionChamber?.frameDocument
?.querySelector('#vtbag-twin--view-transition')
?.remove();

inspectionChamber.frameDocument?.querySelector('#vtbag-twin--view-transition')?.remove();
unleashAllAnimations();
inspectionChamber.animations = undefined;
inspectionChamber.longestAnimation = undefined;
Expand All @@ -147,6 +144,7 @@ function beforeUpdateCallbackDone() {
top!.document.querySelector<HTMLSpanElement>('#vtbag-ui-animations')!.innerText = '';
!root.dataset.vtbagModus &&
top!.document.querySelector<HTMLLIElement>('#vtbag-ui-modi li input')?.click();
inspectionChamber.frameDocument!.addEventListener('click', innerClick);
setTimeout(() => {
const empty = top!.document.querySelector<HTMLDivElement>(
'#vtbag-ui-inner-panel:has( > div:nth-of-type(2):empty)'
Expand Down

0 comments on commit 065d488

Please sign in to comment.