#6255·select2

When triggering events that change the selection, the dropdown UI keeps previous selections highlighted

Author: vlunaCreated May 24, 2023Updated Aug 19, 2026

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: Screenshot 2023-05-24 at 4 33 44 PM