Skip to content

fix: restore filter to input on Escape in multi-select-combo-box - #12738

Open
web-padawan wants to merge 1 commit into
mainfrom
fix/mscb-revert-input-value
Open

fix: restore filter to input on Escape in multi-select-combo-box#12738
web-padawan wants to merge 1 commit into
mainfrom
fix/mscb-revert-input-value

Conversation

@web-padawan

Copy link
Copy Markdown
Member

Description

Pressing Escape while an item is highlighted reverts the input through _revertInputValue(). The base implementation assigns value, which suits a single value field. Multi-select-combo-box keeps its selection in selectedItems, declares value as private and never assigns it, so the assignment always wrote an empty string. The input was cleared while filter stayed set and the overlay stayed open, leaving the list filtered against text the user could no longer see. Combo-box already restores the filter in its own override, which is also what the comment in the base handler describes.

  • Added a _revertInputValue() override that restores the input to the current filter
  • Added tests for Escape on a highlighted item, at the default setting and with keepFilter

The nearest existing test presses Escape twice and only asserts afterwards, so the first press clearing the input was hidden by the second press closing the overlay and clearing the filter for real.

Type of change

  • Bugfix

How to test

  1. Open dev/multi-select-combo-box.html
  2. Type li in the field
  3. Press ArrowDown to highlight an item, the input shows that item's full name
  4. Press Escape
  5. The input shows li again and the dropdown stays open with the filtered items

🤖 Generated with Claude Code

Pressing Escape while an item is highlighted reverts the input through
`_revertInputValue()`. The base implementation assigns `value`, which
multi-select-combo-box declares private and never assigns, so the input
was emptied while `filter` stayed set and the dropdown stayed filtered.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@sonarqubecloud

Copy link
Copy Markdown

@vaadin-review-bot vaadin-review-bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

✅ Nothing to flag — the changes look good.

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.

2 participants