Skip to content
This repository has been archived by the owner on Sep 25, 2021. It is now read-only.

Nested permanent elements replaced with clones #573

Open
pardo-bsso opened this issue Sep 14, 2020 · 0 comments
Open

Nested permanent elements replaced with clones #573

pardo-bsso opened this issue Sep 14, 2020 · 0 comments
Labels

Comments

@pardo-bsso
Copy link

Describe the bug

When having a document structure where an element with tagged with data-turbolinks-permanent is placed inside another one also marked as permanent (depth of hierarchy does not matter) the inner ones are replaced by clones, and thus they lose all their existing event handlers and data.

To Reproduce
There's a bare bones demonstration at https://tangopardo.com.ar/pub/github/turbolinks_nested_issue_demo/index.html
Go to that site, click on 'go to test 2' and hit the 'Compare elements with old dom' button.

Expected behavior
Elements with data-turbolinks-permanent inside others that are permanent are correctly reinserted after a navigation.
In the demo case parent, child-0, child-1 and child-2 should be the same.
Interestingly, if in test2.html I remove data-turbolinks-permanent from child-2 it is correctly re-attached.

Details (please complete the following information):

  • Operating System: Linux x86-64
  • Browser: Firefox 80, Chrome 83.0.4103.61
  • Turbolinks Version: v5.2.0 and 71b7a7d

Thanks for your time

@pardo-bsso pardo-bsso added the bug label Sep 14, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

1 participant