Merge conflict Gerrit cannot merge this change. It needs a rebase onto main.
96865[FEATURE] Add search to backend dropdown menus and selects
Commit message
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
- main 97196[TASK] Use searchable selects in backend modules
-
96865 [FEATURE] Add search to backend dropdown menus and selects This change
Issues 1
Files 36
- Build/Sources/Sass/component/_dropdown.scss+54 −0
- Build/Sources/Sass/element/typo3-backend-searchable-select.scssnew+182 −0
- Build/Sources/Sass/backend.scss+1 −0
- Build/Sources/TypeScript/backend/element/searchable-select-element.ts5new+535 −0
- Build/Sources/TypeScript/backend/form-engine/element/select-country-element.ts+2 −1
- Build/Sources/TypeScript/backend/form-engine/element/select-single-element.ts+2 −1
- Build/Sources/TypeScript/backend/tests/element/searchable-select-element-test.tsnew+599 −0
- Build/Sources/TypeScript/backend/tests/form-engine/element/select-search-test.tsnew+176 −0
- Build/Sources/TypeScript/backend/tests/dropdown-search-test.tsnew+738 −0
- Build/Sources/TypeScript/backend/utility/search-result-highlighter.tsnew+89 −0
- Build/Sources/TypeScript/backend/dropdown-search.ts3new+293 −0
- Build/Sources/TypeScript/backend/dropdown.ts+153 −26
- Build/Sources/TypeScript/styleguide/searchable-select-demo.tsnew+44 −0
- Build/tests/playwright/e2e/configuration/configuration-module-provider.spec.ts+11 −0
- Build/tests/playwright/e2e/layout/contextual-edit-refresh.spec.ts+2 −1
- Build/tests/playwright/e2e/styleguide/searchable-select.spec.tsnew+117 −0
- typo3/sysext/backend/Classes/Form/Element/SelectCountryElement.php+10 −0
- typo3/sysext/backend/Classes/Form/Element/SelectSingleElement.php1+10 −0
- typo3/sysext/backend/Resources/Private/Language/locallang.xlf+6 −0
- typo3/sysext/backend/Resources/Public/Css/backend.css+38 −0
Show 16 more files
- typo3/sysext/backend/Resources/Public/JavaScript/element/searchable-select-element.jsnew+13 −0
- typo3/sysext/backend/Resources/Public/JavaScript/form-engine/element/select-country-element.js+1 −1
- typo3/sysext/backend/Resources/Public/JavaScript/form-engine/element/select-single-element.js+1 −1
- typo3/sysext/backend/Resources/Public/JavaScript/utility/search-result-highlighter.jsnew+13 −0
- typo3/sysext/backend/Resources/Public/JavaScript/dropdown-search.jsnew+13 −0
- typo3/sysext/backend/Resources/Public/JavaScript/dropdown.js+1 −1
- typo3/sysext/backend/Tests/Functional/Form/Element/SearchableSelectElementTest.phpnew+134 −0
- typo3/sysext/core/Documentation/Changelog/15.0/Feature-111144-AddSearchableSelect.rst1new+126 −0
- typo3/sysext/styleguide/Classes/Controller/ComponentsController.php+103 −0
- typo3/sysext/styleguide/Configuration/TCA/tx_styleguide_elements_select.php+111 −2
- typo3/sysext/styleguide/Resources/Private/Language/locallang.xlf+27 −0
- typo3/sysext/styleguide/Resources/Private/Partials/Backend/Form/SearchableSelect.fluid.htmlnew+27 −0
- typo3/sysext/styleguide/Resources/Private/Partials/Backend/Form/SearchableSelectMenu.fluid.htmlnew+18 −0
- typo3/sysext/styleguide/Resources/Private/Templates/Backend/Components/Select.fluid.html+97 −0
- typo3/sysext/styleguide/Resources/Public/JavaScript/element/theme-switcher-element.js+1 −1
- typo3/sysext/styleguide/Resources/Public/JavaScript/searchable-select-demo.jsnew+13 −0
Review log 3043
Show 1218 earlier messages
-
Matthias Vogel uploaded patch set 1 10/19/26, 13:54
-
Matthias Vogel updated the commit message in patch set 2 10/19/26, 13:55
-
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
-
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
-
Matthias Vogel uploaded patch set 3
V -110/19/26, 16:32 -
Matthias Vogel uploaded patch set 4 10/19/26, 16:34
-
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
-
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
-
Matthias Vogel uploaded patch set 5
V -110/19/26, 17:55 -
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
-
Matthias Vogel marked it ready for review 10/19/26, 19:04
-
Georg Ringer voted on patch set 5 CR +1 V +1 10/19/26, 19:10
-
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. -
Matthias Vogel uploaded patch set 6
CR +1V +110/19/26, 20:25 -
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
-
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.. -
Matthias Vogel uploaded patch set 7
V -110/19/26, 21:19Copied Votes: * Code-Review-2 (copy condition: "changekind:NO_CHANGE OR **is:MIN**") -
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...?
-
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
-
Matthias Vogel commented on patch set 7 10/20/26, 08:00
Reply
DoneReply
We talked about it and will disable the search function on mobile devices if it would convert a native select to a popover. -
Matthias Vogel uploaded patch set 8
V -110/20/26, 08:28Copied Votes: * Code-Review-2 (copy condition: "changekind:NO_CHANGE OR **is:MIN**") -
Matthias Vogel uploaded patch set 9 10/20/26, 08:49
Copied Votes: * Code-Review-2 (copy condition: "changekind:NO_CHANGE OR **is:MIN**") -
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
-
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
-
Matthias Vogel uploaded patch set 10
V +110/20/26, 11:01Copied Votes: * Code-Review-2 (copy condition: "changekind:NO_CHANGE OR **is:MIN**") -
Christian Rath-Ulrich voted on patch set 10 V +1 10/20/26, 11:07
-
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
-
Markus Timtner voted on patch set 10 CR +1 10/20/26, 11:25
-
Garvin Hicking voted on patch set 10 CR +1 V +1 10/20/26, 11:34
-
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. -
Sebastian Jansen voted on patch set 10 CR +1 10/20/26, 12:21
-
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 -
Matthias Vogel uploaded patch set 11
CR +1V +110/28/26, 10:13Copied Votes: * Code-Review-2 (copy condition: "changekind:NO_CHANGE OR **is:MIN**") -
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**") -
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
-
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
-
Soren Malling commented on patch set 12 V +1 10/29/26, 06:46
First testing in page properties. Handles input as expected -
Matthias Vogel uploaded patch set 13
V +110/29/26, 09:22Copied Votes: * Code-Review-2 (copy condition: "changekind:NO_CHANGE OR **is:MIN**") -
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 -
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
-
Soren Malling voted on patch set 13 V +1 10/30/26, 01:07
-
Garvin Hicking voted on patch set 13 CR +1 V +1 10/30/26, 11:14
-
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 examplesdropdown-search.ts:36UnresolvedSuggest to mark `DropdownSearch` and `SearchResultHighlighter` as `@internal`, so extensions don't depend on their API.dropdown-search.ts:202UnresolvedPlease catch the rejection and fall back to a static label.dropdown-search.ts:211Unresolved`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:131UnresolvedThis 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:134Unresolved`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:141Unresolved`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:308UnresolvedHm. 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:430Unresolvedthe popup is always aligned to `rect.left`. Should align to `rect.right` in RTL..SelectSingleElement.php:262Unresolvedthe JavaScript module instruction is appended once per field. Please use a fixed key. See `selectSingleElement` below as example.Feature-111144-AddSearchableSelect.rst:34Unresolvedgroup announcements exist only in the select, not in dropdown menus.