When triggering events that change the selection, the dropdown UI keeps previous selections highlighted
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 25.9k
- Forks
- 6.1k
- Avg merge
- 8d 53m
- Merged PRs (30d)
- 4
Description
When using multi select, and trigger events on select, the UI in the dropdown does not reflect the change. In this JSBin I have a selection with months. When you select January an event will be triggered to change the input to December, which works. However, the UI keeps the previous selections highlighted.
It seems like aria-selected is not getting updated in the <li> elements.
Steps to reproduce:
- Select February, March, April
- Then Select January
- December shows as expected but the UI in the dropdown stays the same
- If January is clicked again, the dropdown UI updates
Select2 version: 4.0.6
Browsers:
- Chrome version 113.0.5672.126 (Official Build) (arm64)
- Safari version 16.5 (18615.2.9.11.4)
MacOS 13.4
Screenshots:
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 linked JSBin reproduction and trace the multi-select dropdown update when an event changes the selection. Inspect how aria-selected is applied to the dropdown li elements. Done means programmatic changes update the highlighted options, including the January-to-December case, without requiring another click.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, jquery
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 65/100