-
Notifications
You must be signed in to change notification settings - Fork 436
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove complete state from lazily-loaded frame #1066
Comments
Fixed in #1175 |
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 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 |
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 The complete attribute is read-only |
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. |
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. |
Is it possible to remove the complete state from a lazily-loaded frame, so that the next time it becomes visible, it will request its content again?
Whenever I try to
removeAttribute('complete')
on the frame, the complete changed observer here:turbo/src/core/frames/frame_controller.js
Lines 101 to 105 in a247b35
I've tried setting the src to an empty string and then back again, but this still loads the content as part of the srcUrlChanged callback.
The text was updated successfully, but these errors were encountered: