Skip to content

Conversation

myabc
Copy link
Contributor

@myabc myabc commented Oct 8, 2025

Ticket

https://community.openproject.org/wp/68031

What are you trying to accomplish?

Ensure event listeners are only attached once - on turbo:load.

Screenshots

What approach did you choose and why?

This partially reverts changes made in #19495

Merge checklist

  • Added/updated tests
  • Added/updated documentation in Lookbook (patterns, previews, etc)
  • Tested major browsers (Chrome, Firefox, Edge, ...)

@myabc myabc marked this pull request as ready for review October 8, 2025 17:10
@myabc myabc added needs review bugfix javascript Pull requests that update Javascript code labels Oct 8, 2025
Copy link

github-actions bot commented Oct 8, 2025

Caution

The provided work package version does not match the core version

Details:

Please make sure that:

  • The work package version OR your pull request target branch is correct

Ensure event listeners are only attached once - on `turbo:load`.
@myabc myabc force-pushed the fix/68031-toggleable-fieldsets-not-toggling branch from 7c88ffc to bd0b994 Compare October 8, 2025 20:12
Copy link
Contributor

@HDinger HDinger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not too sure about this change.. Yes, it fixes the issue but looking at the commit message of the deleted line, it was written:

[#65298] Fix broken top bar menus on form errors

Menus in the top bar were not properly initialised after unsuccessful
form submissions that result in an 422 Unprocessable Entity response
via Turbo Drive.

This commit updates Angular-Turbo Drive integration code to listen to
turbo:render in addition to turbo:load. turbo:load is only fired
on Turbo Drive visits. However, a form submission response that is not
a 303 Redirect is not considered a visit by Turbo Drive.

See: hotwired/turbo#85
See also: https://turbo.hotwired.dev/handbook/drive#redirecting-after-a-form-submission

So I guess, this might introduce a regression?

Further, intependent of that: How does tubro interfere with the toggling mechanism at all? And did you try to replace that with the CollapsibleSection component we have in Primer?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix javascript Pull requests that update Javascript code needs review styling

Development

Successfully merging this pull request may close these issues.

2 participants