Combobox filter does not work after removeAllItems
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 1.8k
- Forks
- 717
- Avg merge
- 2d 6h
- Merged PRs (30d)
- 3
Description
Originally by m1kah
Steps to reproduce
- Press tab
- Press enter to click "Change options" button
- Press tab
- Type a
- Verify that "abcde" is shown in suggestion box
- Press shift+tab
- Press enter
- Press tab
- Type a
-Expected behavior*
"abcde" is shown in suggestion box
-Actual behavior*
All values are shown, there is no filtering. Combobox filtering
text field has value 'a'.
Use backspace to remove 'a' and type it again, now filtering works.
You can use this piece of code to reproduce the issue
@Override
protected void init(VaadinRequest vaadinRequest) {
ComboBox comboBox = new ComboBox();
Button button = new Button("Change options");
button.addClickListener((e) -> {
comboBox.removeAllItems();
comboBox.addItem("abcde");
comboBox.addItem("qwerty");
});
setContent(new FormLayout(button, comboBox));
}
Imported from https://dev.vaadin.com/ issue #19702
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the supplied ComboBox reproduction and trace filtering after the button calls removeAllItems() and adds the two replacement items. Confirm the suggestion box still filters for the existing text "a" after the options change, and add or run a regression check if the relevant test location can be found.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100