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

Review main Ready for review Quiet

96865[FEATURE] Add search to backend dropdown menus and selects

Matthias Vogel CR -2 V +1 Nightmare +3761 −35 updated 10/30/26, 15:27

Commit message

Help editors find options more quickly by adding search to backend
dropdown menus and FormEngine single selects.

Dropdown list menus get their search from @typo3/backend/dropdown,
which already handles every backend dropdown. Their markup stays
unchanged, so every list menu behaves the same, whether it is
rendered by DropDownButton, Fluid or JavaScript. Menus can opt out
with data-dropdown-search="false".

Native single selects are enhanced by the new
<typo3-backend-searchable-select> component. FormEngine selectSingle
and country fields use it automatically.

Show the search field automatically for lists with seven or more
options. For shorter lists, typing reveals the search field.
Highlight matches and announce results to screen readers.

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

Review

  • Code review CR -2 Blocked
    • Oli Bartsch -2
    • Garvin Hicking +1
  • Verified V +1 Needs a vote
    • Garvin Hicking +1
    • Soren Malling +1
    • core-ci +1 CI

Relation chain 2

  1. main 97196[TASK] Use searchable selects in backend modules Based on this change Work in progress Merge conflict Matthias Vogel CR 0 V -1 Hard +577 −204
  2. 96865 [FEATURE] Add search to backend dropdown menus and selects This change

Issues 1

Files 36

Show 16 more files

Review log 3043

Show 1218 earlier messages
  1. Matthias Vogel uploaded patch set 1 10/19/26, 13:54

  2. Matthias Vogel updated the commit message in patch set 2 10/19/26, 13:55

  3. core-ci voted on patch set 1 V -1 10/19/26, 14:12 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/111650

  4. core-ci voted on patch set 2 V -1 10/19/26, 14:13 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/111651

  5. Matthias Vogel uploaded patch set 3 V -1 10/19/26, 16:32

  6. Matthias Vogel uploaded patch set 4 10/19/26, 16:34

  7. core-ci voted on patch set 3 V -1 10/19/26, 16:52 Copied votes on follow-up patch sets have been updated: * Verified-1 has been copied to patch set 4 (copy condition: "changekind:NO_CHANGE"). Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/111679

  8. core-ci voted on patch set 4 V -1 10/19/26, 16:56 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/111682

  9. Matthias Vogel uploaded patch set 5 V -1 10/19/26, 17:55

  10. core-ci voted on patch set 5 V +1 10/19/26, 18:17 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/111693

  11. Matthias Vogel marked it ready for review 10/19/26, 19:04

  12. Georg Ringer voted on patch set 5 CR +1 V +1 10/19/26, 19:10

  13. Garvin Hicking commented on patch set 5 CR -1 10/19/26, 19:39

    We're on it, clicking a native select item (e.g. CType) with the mouse does not work. ENTER works.
  14. Matthias Vogel uploaded patch set 6 CR +1 V +1 10/19/26, 20:25

  15. core-ci voted on patch set 6 V -1 10/19/26, 20:40 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/111716

  16. Oli Bartsch commented on patch set 6 CR -2 10/19/26, 21:03

    Let's talk about this. It currently adds a third dropdown/combobox mechanism next to two the core already has. It replaces every FormEngine single select with no way to turn it off and also changes the HTML of every DropDownButton, while the changelog calls it a feature with no impact on existing markup..
  17. Matthias Vogel uploaded patch set 7 V -1 10/19/26, 21:19

    Copied Votes: * Code-Review-2 (copy condition: "changekind:NO_CHANGE OR **is:MIN**")
  18. Garvin Hicking commented on patch set 7 10/19/26, 21:24

    Reply

    We had a variant that added a new appearance.searchable flag for it. We can discuss of course. I would argue it is distinct from a combobox (which has a input text only markup). Adding it to the combobox would kind of pollute the concept of targetted lit components...?
  1. core-ci voted on patch set 7 V -1 10/19/26, 21:27 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/111727

  2. Matthias Vogel commented on patch set 7 10/20/26, 08:00

    Reply

    Done

    Reply

    We talked about it and will disable the search function on mobile devices if it would convert a native select to a popover.
  3. Matthias Vogel uploaded patch set 8 V -1 10/20/26, 08:28

    Copied Votes: * Code-Review-2 (copy condition: "changekind:NO_CHANGE OR **is:MIN**")
  4. Matthias Vogel uploaded patch set 9 10/20/26, 08:49

    Copied Votes: * Code-Review-2 (copy condition: "changekind:NO_CHANGE OR **is:MIN**")
  5. core-ci voted on patch set 9 V +1 10/20/26, 09:11 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/111765

  6. core-ci voted on patch set 8 V +1 10/20/26, 09:29 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/111762

  7. Matthias Vogel uploaded patch set 10 V +1 10/20/26, 11:01

    Copied Votes: * Code-Review-2 (copy condition: "changekind:NO_CHANGE OR **is:MIN**")
  8. Christian Rath-Ulrich voted on patch set 10 V +1 10/20/26, 11:07

  9. core-ci voted on patch set 10 V +1 10/20/26, 11:09 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/111797

  10. Markus Timtner voted on patch set 10 CR +1 10/20/26, 11:25

  11. Garvin Hicking voted on patch set 10 CR +1 V +1 10/20/26, 11:34

  12. Oli Bartsch commented on patch set 10 CR -2 10/20/26, 12:13

    Still a couple of issues, like selecting the first action when submitting an empty search (open a menu with 7+ items, press Enter, item 1 fires), display bugs with overflow on small screens and large lists, the trigger width jumping with every selection because of "form-control-adapt", the on-screen keyboard popping up on touch devices for every dropdown, and broken button-group styling wherever a DropDownButton sits next to other buttons, e.g. the translations action in the file list rows. A select that isn't a direct child of the wrapper even throws on the first keypress. The main point from my -2 is still open, though: this adds a second dropdown implementation next to dropdown.ts. Both handle the same .dropdown-menu[popover], with different keyboard behaviour, and search only reaches menus rendered by DropDownButton. I suggest to move the menu search into dropdown.ts, so it works for every dropdown and the DropDownButton markup stays as it is. Also I still think the select enhancement should be opt-in (e.g. via the appearance flag) instead of replacing every single select with no way to turn it off.
  13. Sebastian Jansen voted on patch set 10 CR +1 10/20/26, 12:21

  14. Garvin Hicking commented on patch set 10 10/20/26, 17:51

    Reply

    Variant, but I stopped working on it for today: https://review.typo3.org/c/Packages/TYPO3.CMS/+/96948
  15. Matthias Vogel uploaded patch set 11 CR +1 V +1 10/28/26, 10:13

    Copied Votes: * Code-Review-2 (copy condition: "changekind:NO_CHANGE OR **is:MIN**")
  16. Matthias Vogel rebased onto patch set 12 10/28/26, 10:15

    Copied Votes: * Code-Review-2 (copy condition: "changekind:NO_CHANGE OR **is:MIN**")
  17. core-ci voted on patch set 12 V +1 10/28/26, 10:25 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/112701

  18. core-ci voted on patch set 11 V -1 10/28/26, 10:25 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/112700

  19. Soren Malling commented on patch set 12 V +1 10/29/26, 06:46

    First testing in page properties. Handles input as expected
  20. Matthias Vogel uploaded patch set 13 V +1 10/29/26, 09:22

    Copied Votes: * Code-Review-2 (copy condition: "changekind:NO_CHANGE OR **is:MIN**")
  21. Matthias Vogel commented on patch set 13 10/29/26, 09:24

    Reply

    Thanks for the detailed list. Patch set 13 addresses it as follows: - Second dropdown implementation: the variant from 96948 (thanks, @garvin@hick.ing) is incorporated. Menu search now lives in the existing dropdown.ts and works for every top-level list menu, whether rendered by DropDownButton, Fluid or JavaScript. Menus can opt out with data-dropdown-search="false". - Button groups: DropDownButton keeps its original markup, so the styling next to other buttons (e.g. file list translations) is unchanged. - Enter on an empty search no longer triggers the first item. - Overflow: menus are limited to the viewport and scroll. The trigger width no longer changes with the selection. - A select that is not a direct child of the wrapper stays native and no longer throws. - On-screen keyboard: on mobile devices, opening a menu no longer focuses the search field, so the keyboard only appears when the field is tapped. Desktop keeps the autofocus. Still open: the FormEngine select enhancement is not opt-in yet. I'd keep it on by default. The long selects editors struggle with (CType, countries, record selectors) mostly come from TCA nobody would revisit to set a flag, so opt-in would leave them unchanged in practice. The enhancement is progressive: the native select stays in the DOM and keeps submitting, validating and firing change events, mobile devices keep the native picker, and multiple selects or size > 1 stay native. For the cases where a field must stay plain, I'd add an opt-out via 'appearance' => ['searchable' => false]. Would that work for you? @bo@cedev.de
  22. core-ci voted on patch set 13 V +1 10/29/26, 09:37 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/112789

  23. Soren Malling voted on patch set 13 V +1 10/30/26, 01:07

  24. Garvin Hicking voted on patch set 13 CR +1 V +1 10/30/26, 11:14

  25. Oli Bartsch commented on patch set 13 CR -2 10/30/26, 15:27

    Reply Unresolved

    Fine for me to have the search opt-out in FormEngine but I still think it should be opt-in for the rest of then backend. I don't see any benefit in having the search in e.g. the "Shortcut" Button of the docheader. Basically all selects in the docheader should be really well considered, e.g. the "View" select in Layout has a single item "Show hidden content elements", and now shows the search .. We IMO should also consider and handle select elements with different sections, e.g. sorting in Media, I think searching for the fields is fine, while the "sort asc, sort desc" should not be hidden at all. So make it short: I'm quite sure there will be a lot of use cases not considered while testing, especially because the element is heavily used by extensions. Making this opt-in for dropdowns etc. is therefore in my opinion a no-brainer. And having opt-out for FormEngine as well. Additionally: * The search field does not behave like search. Pressing ESC closed the whole select instead of just clearing the search term. Also the input misses name or id attribute. * There are still differences between the select and the dropdown. E.g. do the group title have different colors, as you can check in the corresponding styleguide examples

    dropdown-search.ts:36 Unresolved

    Suggest to mark `DropdownSearch` and `SearchResultHighlighter` as `@internal`, so extensions don't depend on their API.

    dropdown-search.ts:202 Unresolved

    Please catch the rejection and fall back to a static label.

    dropdown-search.ts:211 Unresolved

    `prepareLabels()` moves text nodes into a span permanently, which breaks Lit text bindings (Lit updates via `startNode.nextSibling.data`) and contradicts the RST statement that menu markup is unchanged. Please use the CSS Custom Highlight API so no DOM mutation is needed, or at least revert the wrapping in `reset()`.

    searchable-select-element.ts:131 Unresolved

    This is one of the most visible things in my test.. The trigger copies `form-control-adapt` (`width:auto`), so it is only as wide as the current label, unlike a native select. The field width jumps on every selection, and an empty "none" item shrinks it to the padding. Can we please size the trigger to the widest option (e.g. reuse the sizer) and add a test that the trigger width stays stable across selections?

    searchable-select-element.ts:134 Unresolved

    `aria-label` includes the value, and both the trigger and the search input are `role=combobox` for one listbox. Please name the trigger via `aria-labelledby` pointing to the field label, as in the select-only combobox pattern.

    searchable-select-element.ts:141 Unresolved

    `render()` builds the full listbox and the hidden sizer for every select, also while closed, and `readSelect()` re-renders everything on each attribute mutation. Please render the listbox and sizer only while `isOpen`.. We could also cache the normalised labels in `readSelect()`, and return early in the document `pointerdown` handler when closed.

    searchable-select-element.ts:308 Unresolved

    Hm. why do we hard-code the threshold? Please use `DropdownSearch.threshold`, ideally with a shared helper for the duplicated scroll, announce and backspace logic.

    searchable-select-element.ts:430 Unresolved

    the popup is always aligned to `rect.left`. Should align to `rect.right` in RTL..

    SelectSingleElement.php:262 Unresolved

    the JavaScript module instruction is appended once per field. Please use a fixed key. See `selectSingleElement` below as example.

    Feature-111144-AddSearchableSelect.rst:34 Unresolved

    group announcements exist only in the select, not in dropdown menus.