Skip to content

Commit

Permalink
Merge pull request #1195 from seanpdoyle/rollback-1141
Browse files Browse the repository at this point in the history
Omit `ignoreActiveValue: true` Morph option
  • Loading branch information
jorgemanrubia authored Feb 21, 2024
2 parents fccb3a4 + 37d2dd6 commit 3a8e2d9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
1 change: 0 additions & 1 deletion src/core/drive/morph_renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ export class MorphRenderer extends PageRenderer {
this.isMorphingTurboFrame = this.#isFrameReloadedWithMorph(currentElement)

Idiomorph.morph(currentElement, newElement, {
ignoreActiveValue: true,
morphStyle: morphStyle,
callbacks: {
beforeNodeAdded: this.#shouldAddElement,
Expand Down
8 changes: 8 additions & 0 deletions src/tests/fixtures/page_refresh.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,14 @@

const application = Application.start()

addEventListener("focusin", ({ target }) => {
if (target instanceof HTMLInputElement && !target.hasAttribute("data-turbo-permanent")) {
target.toggleAttribute("data-turbo-permanent", true)

target.addEventListener("focusout", () => target.toggleAttribute("data-turbo-permanent", false), { once: true })
}
})

addEventListener("turbo:morph-element", ({ target }) => {
for (const { element, context } of application.controllers) {
if (element === target) {
Expand Down

0 comments on commit 3a8e2d9

Please sign in to comment.