#6460·select2

Clicking the remove button on a selected choice also toggles the dropdown (multiple selects only)

Author: VulumeCodeCreated Sep 21, 2026Updated Sep 22, 2026

Summary — In a multiple select, clicking the × on a choice fires unselect and bubbles into the selection container's click handler, which fires toggle. With closeOnSelect: true this is hidden (unselect closes, the stray toggle reopens, net result always open); with closeOnSelect: false nothing counteracts it, so the dropdown flips state on every removal. Only affects multiple selects — single selects have no per-choice remove button, and allowClear's × already calls stopPropagation().

Steps — init a 4-option multiple select with closeOnSelect: false, select all four, then click each × in the selection box in turn; the dropdown alternates closed/open on every click.

Cause — src/js/select2/selection/multiple.js: the delegated click handler on .select2-selection__choice__remove never stops the event, so it reaches the container's toggle handler. Two neighbours already guard against this — the keydown handler directly below it, and AllowClear.prototype._handleClear — so the click path looks like the one case that was missed.

Fix — add evt.stopPropagation(); to that handler. The report also includes the external workaround as a fallback.

Reproduced on 4.1.0 and 4.0.13, only tested my fix on 4.0.13.