Skip to content

Commit

Permalink
Move the disconnectedCallback() call
Browse files Browse the repository at this point in the history
The fix introduced in [hotwired#454][] resolved the issue, but
introduced a matching `disconnectedCallback()` far-off in the
`FrameRenderer`.

This commit moves that call to occur _immediately_ after it's paired
`element.connectedCallback()`.

[hotwired#454]: hotwired#454
  • Loading branch information
seanpdoyle committed Nov 18, 2021
1 parent 774b4b9 commit 7cae7cd
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 1 deletion.
1 change: 1 addition & 0 deletions src/core/frames/frame_controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -439,6 +439,7 @@ function activateElement(element: Element | null, currentURL?: string | null) {

if (element instanceof FrameElement) {
element.connectedCallback()
element.disconnectedCallback()
return element
}
}
Expand Down
1 change: 0 additions & 1 deletion src/core/frames/frame_renderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ export class FrameRenderer extends Renderer<FrameElement> {
if (sourceRange) {
sourceRange.selectNodeContents(frameElement)
this.currentElement.appendChild(sourceRange.extractContents())
frameElement.disconnectedCallback()
}
}

Expand Down

0 comments on commit 7cae7cd

Please sign in to comment.