Expose text-editing accessibility semantics on the editor - #30
Merged
Conversation
The editable Box was focusable and wired to the platform IME, but published no text-editing semantics. As a result accessibility services (VoiceOver / TalkBack) couldn't read or edit its content, and on iOS the platform never exposed the focused editor as a keyboard-focused text element — so UI-test frameworks like XCUITest couldn't type into it (no element reports `hasKeyboardFocus`). Add a `Modifier.semantics` block, wired to the existing TextEditorState API, exposing `editableText`, `textSelectionRange`, `setText`, `insertTextAtCursor`, `setSelection`, and `onClick` (request focus). This makes the node a first-class editable text field for accessibility, and lets XCUITest drive text entry (verified end to end against a downstream app on the iOS simulator). 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.
What
Adds a
Modifier.semantics { }block to the editableBoxinBasicTextEditor, exposing text-editing semantics wired to the existingTextEditorState:editableText,textSelectionRange(read)setText,insertTextAtCursor,setSelection(edit actions)onClick { requestFocus }Why
The editor was
focusable()and integrated with the platform IME viaPlatformTextInputModifierNode, but published no text-editing semantics. Consequences:app.typeTextfails its "is any element keyboard-focused?" pre-check). StandardBasicTextFields work precisely because they publish these semantics.Validation
Verified end to end: published a snapshot to mavenLocal, pointed a downstream Compose Multiplatform app (hammer-editor) at it, and confirmed an XCUITest that creates a note by typing into the editor body now passes on the iOS simulator — previously blocked at the keyboard-focus check.
Behavior for existing consumers is unchanged; the semantics are additive.
🤖 Generated with Claude Code