Merge conflict Gerrit cannot merge this change. It needs a rebase onto main.

Review main Ready for review

85477[TASK] Do not auto-toggle TWBS Collapse on initialization

Ayke Halder CR 0 V 0 Easy +21 −20 updated 11/11/26, 13:33

Commit message

The Bootstrap Collapse constructor defaults to `toggle: true` and
toggles the element as soon as an instance is created. A first call
of `Collapse.getOrCreateInstance(element).show()` on an element that
is already shown therefore collapses it, and the subsequent `show()`
is ignored because a transition is running. The same applies to
`hide()` on a hidden element, which ends up being expanded.

All programmatically created Collapse instances, including the ones
of FlexForm containers and inline records, now pass `toggle: false`
and explicitly show or hide the element afterwards, like Bootstrap's
own data API and the module menu already do.

Test this change

Run a command in your clone of the TYPO3 Core. Then try what the change does and vote on Verified in Gerrit. How to review a patch

Check out patch set 5
git fetch https://review.typo3.org/Packages/TYPO3.CMS refs/changes/77/85477/5 && git checkout FETCH_HEAD
Cherry-pick onto main
git fetch https://review.typo3.org/Packages/TYPO3.CMS refs/changes/77/85477/5 && git cherry-pick FETCH_HEAD

Review

  • Code review CR 0 Needs a vote
  • Verified V 0 Needs a vote
    • core-ci +1 CI

Issues 1

Files 12

Review log 914

  1. Ayke Halder uploaded patch set 1 08/01/24, 21:39

  2. core-ci voted on patch set 1 V +1 08/01/24, 21:50 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/62675

  3. Ayke Halder uploaded patch set 2 V +1 08/01/24, 21:54

  4. core-ci voted on patch set 2 V +1 08/01/24, 22:02 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/62680

  5. Benni Mack commented on patch set 2 04/15/25, 15:18

    shouldn't we just switch to native collapse (get rid of twbs collapse dependency in this case)?
  6. Ayke Halder commented on patch set 2 04/16/25, 12:44

    Reply

    A proper collapse implementation must take care of: * Keyboard control * ARIA attributes * open/close animation Sure we can drop TWBS collapse. But to do so I'd rather take the original TWBS collapse code instead of newly implementing it. Then do a slim down to the essential functionality and refactore it into a JS web-component for TYPO3. TWBS is licensed under MIT - what's the procedure to properly reuse this code in TYPO3? See: https://github.com/twbs/bootstrap/blob/ed36faae9dcd03f1fbf5bbbf859c706e63ae24c9/js/src/collapse.js https://github.com/twbs/bootstrap/blob/ed36faae9dcd03f1fbf5bbbf859c706e63ae24c9/scss/_transitions.scss#L9-L27 https://github.com/twbs/bootstrap/blob/ed36faae9dcd03f1fbf5bbbf859c706e63ae24c9/scss/_variables.scss#L584-L587
  7. Ayke Halder uploaded patch set 3 V +1 04/16/25, 13:28

  8. core-ci voted on patch set 3 V +1 04/16/25, 13:34 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/77840

  9. Benni Mack wrote 04/21/26, 14:58

    Removed cc Benni Mack.
  10. Benni Mack uploaded patch set 4 V +1 10/14/26, 15:24

  11. core-ci voted on patch set 4 V +1 10/14/26, 15:34 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/111121

  12. Benni Mack commented on patch set 4 10/14/26, 15:44

    Reply

    lets stick to this one now. thanks for the patch.
  13. Benni Mack uploaded patch set 5 V +1 11/11/26, 13:23

  14. core-ci voted on patch set 5 V +1 11/11/26, 13:33 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/114083