Skip to content

fix(node): fire input event when selecting an option - #334

Merged
route merged 1 commit into
mainfrom
fix/select-input-event
Oct 14, 2026
Merged

route merged 1 commit into
mainfrom
fix/select-input-event

Conversation

@route

@route route commented Oct 14, 2026 •

Copy link
Copy Markdown
Member

Fixes #223.

Node#select_option / Node#unselect_option dispatched only change on the <select>, so input listeners (Stimulus, Alpine, auto-submitting forms) never ran.

  • Dispatch a bubbling, composed input event on the select right before change, matching what browsers fire per the HTML spec.
  • Resolve the target with node.closest("select") so options inside an <optgroup> focus/blur/input the select instead of the optgroup.

change still fires unconditionally, as before, to avoid breaking suites that re-select the current option.

@route
route force-pushed the fix/select-input-event branch from 9d8c03e to f09e18a Compare October 14, 2026 19:00
@route
route merged commit 3e0b1aa into main Oct 14, 2026
7 checks passed
@route
route deleted the fix/select-input-event branch October 14, 2026 19:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

BUG: select actions does not trigger "input" events (only "change" event) on select inputs/dropdowns

1 participant