- Status changed to Closed: won't fix
about 1 month ago 3:40am 11 October 2024 - 🇨🇦Canada ambient.impact Toronto
Going to close this as won't fix because there's no realistic way we could do this without breaking various things.
The main problem this causes is that behaviours can continue to attach to a page after a Turbo visit, making DOM changes and inserting elements that likely won't do anything. This is exacerbated by Turbo 8.0.0-beta.3 which added a feature to automatically remove unused CSS files when performing a visit to a new page via Turbo; this feature is a good addition, but it means that any elements added to the DOM via one of these lingering behaviours that expects certain styles to be present to hide them until needed will no longer be present, possibly resulting in broken-looking pages.
See above.
I'm not really sure. This is a difficult one because we can't predict which JavaScript files add behaviours, and because of the way that behaviours are just added as properties to the Drupal.behaviors
global, there's no abstraction layer that we could insert ourselves into to intercept such additions and make note of what gets added and when. This is where something similar to the dependency injection container but in Drupal's JavaScript would be immensely useful.
¯\_(ツ)_/¯
Maybe override Drupal.behaviors
with our own implementation that notifies us when properties are added and combine that with a Mutation Observer? That's the best I can think of at the moment.
None, other than less broken stuff.
None?
None, well, probably none.
Active
2.0
Code
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.
Going to close this as won't fix because there's no realistic way we could do this without breaking various things.