Repository navigation
feat: a11y completion + AbortSignal + grouped options (v3.2.0) - #3
Merged
Merged
Conversation
… — v3.2.0 Tier 1 of the feature roadmap: - Accessibility: ARIA combobox/listbox pattern. Options get stable ids; active row gets aria-selected and is referenced by the input's aria-activedescendant; input gains aria-controls/aria-haspopup; a visually-hidden aria-live region announces result counts, "Searching…", and the no-matches/create state. - AbortSignal: async source ctx now carries a real `signal` (a newer search aborts the previous; remoteSource passes it to fetch; destroy() aborts too). Fixes the doc/code mismatch where `signal` was documented but never provided. - Grouped options: groupBy(option) fn or per-option `group` field render optgroup-style headings (.liveselect__group); results stably reordered. Includes 4 new jsdom tests (30 total), CSS for group headings, README sections (Grouped options, Accessibility) + options-table rows, a grouped-options demo in examples/vanilla.html, and CHANGELOG/version bump to 3.2.0. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Tier 1 of the agreed roadmap — three additive features, no breaking changes.
1. Accessibility (ARIA combobox/listbox pattern)
ids; the active row carriesaria-selected="true"and is referenced by the input'saria-activedescendant(so arrow-key nav is announced).aria-controls(→ menu) andaria-haspopup="listbox".aria-live="polite"region announces result counts, "Searching…", and the no-matches/create state.2. AbortSignal for async sources
sourcectxnow includes a realsignal→{ scope, limit, query, signal }.remoteSourcepasses it tofetch;destroy()aborts in-flight too.signalwas documented on line 27 but never actually provided.3. Grouped options
groupBy(option) => stringfunction or per-optiongroupfield →<optgroup>-style headings (.liveselect__group).activeIndex/keyboard nav stay consistent with the reordered list.Changes
dist/liveselect.js— a11y wiring, AbortController per search,_group/_groupOf/_announcehelpers,groupfield innormalizeOption,remoteSourcepassessignaldist/liveselect.css—.liveselect__groupheading styletest/client.test.js— 4 new tests (a11y ids/activedescendant/live-region, abort-on-supersede, grouping reorder, groupBy precedence) → 30/30 passREADME.md— Grouped options + Accessibility sections, options-table rows, async-ctx note, Features bulletexamples/vanilla.html— grouped-options demo (section 5)CHANGELOG.md+package.json— bump to 3.2.0Test plan
npm test→ 30/30 (was 26); existing XSS/escaping regressions still pass🤖 Generated with Claude Code