Skip to content

AbstractCombobox.onInput() is a public no-op — input event never dispatched #659

Description

@fpigeonjr

Context

Found while adding specs for #635.

AbstractCombobox (src/ui-kit/experimental/aria/abstract-combobox/abstract-combobox.ts) declares:

public onInput(callback: Function, context: Object): void {
  this._dispatcher.on("input", callback, context);
}

and registers "input" as a valid event name in _initEventDispatcher, but nothing in the class ever calls this._dispatcher.dispatch("input", ...). The native input DOM event listener in _setupInputEvents only dispatches "search":

this._input.addEventListener("input", (e) => {
  this._dispatcher.dispatch("search", e);
});

So any consumer calling combobox.onInput(cb, ctx) registers a callback that is never invoked — a dead public API.

Suggested fix

Either dispatch "input" alongside (or instead of) "search" from the native input listener, or remove/privatize onInput if it isn't part of the intended public contract.

Origin

Flagged by Copilot review on PR #654 (#654 (comment)). Left out of that PR since it is a spec-only PR and this is a pre-existing implementation bug.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions