Skip to content

Show typed text over the current selection in typeahead selects - #51547

Merged
edewit merged 2 commits into
keycloak:mainfrom
ssilvert:issue-50535-rsc-typeahead-dropdown
Aug 10, 2026
Merged

Show typed text over the current selection in typeahead selects#51547
edewit merged 2 commits into
keycloak:mainfrom
ssilvert:issue-50535-rsc-typeahead-dropdown

Conversation

@ssilvert

@ssilvert ssilvert commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

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 #50535

Assisted-by: Claude Opus 5

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
@ssilvert
ssilvert requested review from a team as code owners August 7, 2026 17:12
Copilot AI balanced review requested due to automatic review settings August 7, 2026 17:12

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copilot AI review requested due to automatic review settings August 7, 2026 17:43

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.

@edewit
edewit merged commit 6194613 into keycloak:main Aug 10, 2026
91 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Admin UI: Resource search does not work in Authorization Evaluate “Resources and Scopes - Key” selector

3 participants