Code Monkey home page Code Monkey logo

Comments (5)

brunoprietog avatar brunoprietog commented on August 23, 2024

Fixed in #1175

from turbo.

wooly avatar wooly commented on August 23, 2024

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.

brunoprietog avatar brunoprietog commented on August 23, 2024

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.

wooly avatar wooly commented on August 23, 2024

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.

brunoprietog avatar brunoprietog commented on August 23, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.