Repository navigation
feat: let a host form field label and describe Flicker.select/1 - #16
Merged
Merged
Conversation
Add aria_labelledby, aria_describedby and aria_invalid to Flicker.select/1. The colocated .Nav hook now pushes "query" for text that arrives with no key held, such as a context-menu paste, drag and drop, or autofill.
C-Sinclair
force-pushed
the
feat/combobox-field-aria
branch
from
November 10, 2026 15:45
e650c24 to
f1d1168
Compare
C-Sinclair
marked this pull request as ready for review
November 10, 2026 16:00
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.
A host app that renders
Flicker.select/1inside its own form field needs to name and describe the combobox input itself. This PR adds three attrs toFlicker.select/1and fixes searches for text that arrives without a keystroke.aria_labelledby(string, defaultnil) points the input'saria-labelledbyat a host element. When set,combobox_input/1skips Flicker's visually-hidden<label>, so screen readers stop reading the name twice. The listbox'saria-labelledbyuses the same id.aria_describedby(string of ids, defaultnil) is appended after Flicker's own hint ids fromdescribedby/4on the input'saria-describedby.aria_invalid(boolean, defaultfalse) rendersaria-invalid="true"on the input only whentrue..Navhook'sattachCursorReportingnow counts keys held on the input. Aninputevent with no key held pushes"query"with the value and cursor. Context-menu paste, drag and drop, and autofill take this path. Typing and Ctrl/Cmd+V hold a key, so they still go throughphx-keyupand its debounce and are not pushed twice. The server'shandle_event("query", ...)already ignores a repeat with unchanged text and cursor.Flicker.palette/1andFlicker.search/1render their own inputs and do not callcombobox_input/1, so they are unchanged.The new
Flicker.SelectFieldAriaTestrenders each attr and checks the server runs a search for a keyless"query"push. The hook'sinputlistener and key counting are JavaScript, which ExUnit cannot run. That part needs a browser check.CHANGELOG.mdhas no entry here becausegit_opswrites it from the commit at release.