Show typed text over the current selection in typeahead selects - #51547
Merged
edewit merged 2 commits intoAug 10, 2026
Conversation
The single typeahead locked its input to `selections` whenever one was set, so typing over an existing selection was invisible and filtered on the wrong string. Gate the displayed value on whether the user is editing instead, and stop pinning the filter to the item just picked. Fixes keycloak#50535 Signed-off-by: Stan Silvert <ssilvert@redhat.com> Assisted-by: Claude Opus 5
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes typeahead selects so typed text replaces the displayed selection and filters options correctly.
Changes:
- Tracks active filtering separately from the selected value.
- Resets filtering when selection/editing ends.
- Adds authorization evaluation browser tests.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
js/libs/ui-shared/src/select/TypeaheadSelect.tsx |
Updates typeahead editing and filtering behavior. |
js/apps/admin-ui/test/clients/authorization.ts |
Adds evaluation-select test helpers. |
js/apps/admin-ui/test/clients/authorization.spec.ts |
Tests filtering, replacement, and cancellation. |
| <Button | ||
| variant="plain" | ||
| onClick={() => { | ||
| onSelect?.(""); |
The clear button always called onSelect(""), which stores an empty entry
rather than an empty selection: ResourcesPolicySelect ends up with [""],
whose length satisfies the required check with nothing actually selected.
Prefer the onClear callback, which was declared on KeycloakSelectProps but
consumed by neither select implementation, and keep onSelect("") as the
fallback.
Signed-off-by: Stan Silvert <ssilvert@redhat.com>
Assisted-by: Claude Opus 5
edewit
approved these changes
Aug 10, 2026
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.
The single typeahead locked its input to
selectionswhenever one was set, so typing over an existing selection was invisible and filtered on the wrong string. Gate the displayed value on whether the user is editing instead, and stop pinning the filter to the item just picked.Fixes #50535
Assisted-by: Claude Opus 5