Custom elements aren't treated as turbo frames
See original GitHub issueHi! 👋
There is an issue between turbo and tables - turbo-frames cannot wrap tr, tbody
and similar elements without breaking the styles.
One of the workarounds is to use custom-elements and just write <tr is="turbo-frame">
- solves most of the problems.
However, if you do a request from within this fake turbo-frame
element and the response returns a template, turbo cannot find a matching turbo-frame
element and returns an error: Response has no matching <turbo-frame...
Personally I fixed it with patching turbo
query selecting.
Currently it’s:
querySelector(`turbo-frame#${id}`)
Changing it to this worked:
querySelector(`turbo-frame#${id}, [is="turbo-frame"]#${id}`)
Would this change be acceptable as a PR or this (custom elements with is=“” attribute) is not the way to go with turbo?
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:8 (2 by maintainers)
Top Results From Across the Web
Custom elements aren't treated as turbo frames #313 - GitHub
Hi! There is an issue between turbo and tables - turbo-frames cannot wrap tr, tbody and similar elements without breaking the styles.
Read more >Turbo frames not working - Hotwire Discussion
Any help? It sounds like Turbo might be loaded twice and it's trying to define an existing turbo custom element. Has anything recently...
Read more >Turbo Frames on Rails - Colby.so
Turbo Frames and page layouts Turbo Frames in the DOM are implemented as custom HTML elements (the <turbo-frame> tag we've seen in this...
Read more >Rails: Turbo Frame / Turbo Stream element is not rendered ...
Rails: Turbo Frame / Turbo Stream element is not rendered the SECOND time I trigger it - Stack Overflow. Stack Overflow for Teams...
Read more >Documentation for turbo-rails (1.0.0) - RubyDoc.info
Turbo reinvents the old HTML technique of frames without any of the drawbacks that lead to developers abandoning it. With Turbo Frames, you...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Promote this solution with Pull Request and wait for the result. I need to use tables and your solution, it also supports browsers that do not support the “is” attribute for the moment.
I wanted to add test cases before opening PR, but somehow can’t get test to properly work.