Review main Ready for review Quiet

97260[BUGFIX] Add side-by-side options only on option click

Georg Ringer CR 0 V 0 Easy +2 −1 updated 11/03/26, 19:20

Commit message

Clicking the border or a group name of the available options list of
selectMultipleSideBySide added the option that was still highlighted,
for example the one that had just been removed from the selected list.

An option that has been added to the selected list is now deselected
in the available options list. Later clicks on the border or a group
name, as well as the Enter key, no longer find a highlighted option
and add nothing.

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 2
git fetch https://review.typo3.org/Packages/TYPO3.CMS refs/changes/60/97260/2 && git checkout FETCH_HEAD
Cherry-pick onto main
git fetch https://review.typo3.org/Packages/TYPO3.CMS refs/changes/60/97260/2 && git cherry-pick FETCH_HEAD

Review

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

Merge conflicts 1

Issues 1

Files 2

Review log 68

  1. Georg Ringer uploaded patch set 1 10/31/26, 14:10

  2. Georg Ringer commented on patch set 1 10/31/26, 14:11

    This change is ready for review.
  3. core-ci voted on patch set 1 V +1 10/31/26, 14:18 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/112959

  4. Lukas Dörr commented on patch set 1 CR +1 V +1 11/01/26, 11:58

    Tested with EXT:styleguide, field select_multiplesidebyside_2. Browsers: Firefox 160.0b3 (Linux, 64-bit) and Chromium 156.0.8078.79 (Linux, x86_64). clicking a group label or the empty area / border of the available items list no longer adds anything. No regressiond found: - clicking an option adds it - multi-select via Ctrl+click works - adding a highlighted option via Enter works - adding an option from a filtered list works - saving and reloading keeps the selection
  5. Oli Bartsch commented on patch set 1 11/01/26, 16:57

    select-multiple-side-by-side-element.ts:43

    the transferred option keeps `option.selected = true` after `setSelectOptionFromExternalSource` hides it, and `removeOption` re-enables it still selected. That's why a click re-adds it and why it comes back highlighted. Other readers of `option:checked` (Enter key, the exclusive/single-value re-enable paths in `form-engine.ts`) still see it too. Please clear it once the option is handed over, e.g. `optionElement.selected = false` in `handleOptionChecked` after `setSelectOptionFromExternalSource` (this also covers TCA `multiple=true`, where the option isn't hidden), or next to `optionEl.disabled = true`. With that in place the target guard shouldn't be needed anymore.

    select-multiple-side-by-side-element.ts:44

    if mousedown and mouseup land on different options (slight movement on a trackpad), `click` fires on the common ancestor (`OPTGROUP` or `SELECT`). The browser selects the release option, but the guard skips `handleOptionChecked`, so nothing is added and the option is just highlighted. Dropping the guard as above fixes this; if you still want one, please decide by the mousedown target instead of the click target.
  6. Georg Ringer uploaded patch set 2 CR +1 V +1 11/03/26, 19:02

  7. Georg Ringer commented on patch set 2 11/03/26, 19:03

    select-multiple-side-by-side-element.ts:43 Reply

    Done

    select-multiple-side-by-side-element.ts:44 Reply

    Done
  8. core-ci voted on patch set 2 V +1 11/03/26, 19:20 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/113205