Add search to Builder block picker - #20469
Open
KianAcquoy wants to merge 6 commits into
Open
Conversation
danharrin
requested changes
Sep 9, 2026
danharrin
left a comment
Member
There was a problem hiding this comment.
Thanks for this! A few things need addressing before we merge:
- Please keep the search labels in sync when the available blocks change, for example when a block reaches
maxItems(). Alpine currently retains the original labels array after a Livewire morph, so searches can hide the wrong blocks. - Escape currently closes the picker as well as clearing the search. The dropdown handles Escape before the input’s
stopPropagation(). Please make the first Escape clear a nonempty search, then close on the next Escape and return focus to the trigger. - Please search HTML labels as they appear to the user. Stripping tags leaves entities encoded, so a label displaying
R&Ddoesn’t match a search forR&D. - Please add tests for the new configuration and browser behavior, including changing available blocks, keyboard interaction, and accessibility checks in light and dark modes.
- Please define the supported search configuration directly on
Builderrather than usingCanBeSearchable. That concern also exposes methods such assearchValues()andsearchLabels()which have no effect here.
Contributor
Author
|
Thank for the feedback, Dan. I've addressed all points in my latest commit. While moving off CanBeSearchable I noticed CheckboxList has the same issue: it uses the concern but never reads searchingMessage(), noOptionsMessage(), searchLabels() or searchValues(). Maybe we should resolve that in a follow-up PR? |
Member
|
Yeah a follow up PR would be good thanks |
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adds an opt-in search field to the
Builderblock picker, to quickly filter large block lists. It reuses theCanBeSearchableconcern fromCheckboxList, sosearchPrompt(),noSearchResultsMessage()andsearchDebounce()are also supported. The field is auto-focused when the picker opens, using a new reactiveisOpenproperty on the shared dropdown Alpine component.Visual changes
Without

searchableWith


searchableFunctional changes
composer cscommand.