Repository navigation
feat: disabled options + required validation + Tier 3 polish (v3.3.0) - #4
Merged
Merged
Conversation
Tier 2 (minus multi-select) plus all Tier 3 polish from the roadmap:
- Disabled options: per-option `disabled: true` → non-selectable (dimmed,
aria-disabled, skipped by keyboard nav, ignored on click/Enter).
- Required validation: enforced via the Constraint Validation API on the
visible input, so an empty required control blocks submit with a focusable,
on-screen bubble. Makes enhance()'s required actually enforce (a display:none
<select> can't be focused). Message via texts.required.
- Match highlighting: `highlight: true` wraps the matched substring in <mark>
(built from text nodes → still XSS-safe). Ignored for renderOption rows.
- "Showing N of M" footer: array sources compute total; async sources may
return { items, total }. Customize via texts.more(shown, total).
- Lifecycle events: bubbling liveselect:open / liveselect:close /
liveselect:search ({ query }).
- Async result caching: `cache: true` keys by query+scope+limit; cleared by
setSource()/setScope().
6 new jsdom tests (36 total), CSS for disabled/mark/more + dark-mode mark,
README (options table, Events table, Validation section, Features bullet),
example updated (highlight + a disabled row), CHANGELOG/version bump to 3.3.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 2 (minus multi-select) + all four Tier 3 polish items from the roadmap. All additive, no breaking changes.
Disabled options
disabled: true→ non-selectable: dimmed,aria-disabled, skipped by ↑/↓ nav, ignored on click/Enter.requiredform validationtexts.required).enhance(): adisplay:nonerequired<select>can't be focused (browsers reject submit with "invalid form control is not focusable"); enforcement now lives on the visible control.Match highlighting
highlight: truewraps the matched substring in<mark class="liveselect__mark">, built from text nodes (no innerHTML) so it stays XSS-safe. Ignored forrenderOptionrows."Showing N of M" footer
{ items, total }. Customize viatexts.more(shown, total).Lifecycle events
liveselect:open,liveselect:close,liveselect:search({ query }), alongsideliveselect:change.Async result caching
cache: truememoizes async results by query+scope+limit; cleared bysetSource()/setScope().Changes
dist/liveselect.js—disabledinnormalizeOption;_step/_isEnabledkeyboard skip;_syncValidity;_highlightInto;_total+ cache in_runSearch;_dispatch+ open/close/search events; "more" footer in_renderMenudist/liveselect.css—__opt--disabled,__mark(+ dark),__moretest/client.test.js— 6 new tests → 36/36 passREADME.md— options table, option shape, async-ctx, Events table, Validation section, Features bulletexamples/vanilla.html— picker 1 now useshighlight+ a disabled rowCHANGELOG.md+package.json— bump to 3.3.0Test plan
npm test→ 36/36 (was 30); existing XSS/escaping/a11y regressions still pass🤖 Generated with Claude Code