Comments (5)
Fixed in #1175
from turbo.
Hi @brunoprietog, I've just gotten round to upgrading to turbo 8.0.5 (I think this was closed as part of 8.0.4), but I'm still experiencing this issue. As soon as I removeAttribute("complete")
, it just gets added in again straight away.
My use case is a dropdown menu that contains a turbo frame. Whenever the dropdown menu opens, the turbo frame should be requested. When the dropdown menu closes, the turbo frame is cleared and the complete attribute is removed, so that it is re-requested the next time the dropdown menu opens. When I upgrade to 8.0.5
, the turbo frame is not requested and my dropdown stays empty.
from turbo.
Could you show some code? Anyway, the complete attribute is not intended to be used that way. Instead, you could reload the Turbo frame maybe? Delete the contents of the Turbo frame with something like frame.replaceWith()
and frame.src = null
.
The complete attribute is read-only
from turbo.
I'll work up a little example if I can replicate the behaviour, definitely yep.
Hmm, the intention is not to reload the frame but to cause it to reset back to what it was before it was fetched, so when the element becomes visible again, it will trigger the fetch again.
from turbo.
There's a better way to accomplish the same thing. Check this example:
<a href="/menu" popovertarget="menu" data-turbo-frame="menu" role="button">Menu</a>
<turbo-frame id="menu" popover></turbo-frame>
Each time you click on the link, the Turbo frame will reload from the URL/menu. If you click outside or press escape, the menu will close automatically thanks to the popover attribute.
from turbo.
Related Issues (20)
- Preserve scroll position when morphing turbo frames
- turbo:morph-element fires twice
- Form not displaying errors on page HOT 2
- Morph with infinite scroll
- turbo-frame with text only not rendering on restoration visits
- How to prevent element from being removed during morph? HOT 3
- data-turbo="false" misbehaviour HOT 1
- Drive: Navigating back from a 3xx redirect to an external page makes turbo show 'loading' forever
- Morph skip render some elements
- Duplicating DOM elements with `before` and `after` turbo streams actions
- Reconsider adding `turbo:after-stream-render` event HOT 3
- Input field missing from form with errors, even though it is in the HTML response
- Turbo does not work with Declarative Shadow DOM HOT 1
- It's unfortunate that Turbo overloads the concept of "action", is it too late to rename "Turbo actions"? HOT 1
- Turbo Frame + Nginx Cache
- Turbo Stream rendering plain text html instead of replacing content in targeted turbo frame HOT 2
- Turbo Confirm is Ignored without Turbo Method HOT 2
- Please allow rendering after successful POST form submissions
- Progress bar completely missing in Rails 7.1
- Modifier keys ignored for form submissions
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from turbo.