You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'd like to create a dropdown with the Toggle feature. However, the toggle will remain open on hitting the back button with Turbolinks. Using stimulus and turbolinks, I'd normally either remove the node or add / remove a class.
Maybe there is room for a before cache feature? Or alternatively, maybe an event feature might keep it more flexible?
The text was updated successfully, but these errors were encountered:
Can you solve this problem by using <details> instead of toggle? Alternatively, you could write some Javascript that listens for turbolinks:load and toggles your element by sending a click event. I do something very similar to this on the Trimmings docs, in fact; check out adjustNav in the source.
Trimmings strives to augment existing DOM APIs, so in essence it already does have an event option. Since most Trimmings feature are listening for clicks and submits, you can send a click or submit event to a Trimmings-bound element yourself based on whatever logic you may need for your particular use case.
I think this answers your question, but let me know if I've missed the point here. Thanks!
I'd like to create a dropdown with the Toggle feature. However, the toggle will remain open on hitting the back button with Turbolinks. Using stimulus and turbolinks, I'd normally either remove the node or add / remove a class.
Maybe there is room for a before cache feature? Or alternatively, maybe an event feature might keep it more flexible?
The text was updated successfully, but these errors were encountered: