Repository navigation
Description
Preflight Checklist
- I have read the Contributing Guidelines for this project.
- I agree to follow the Code of Conduct that this project adheres to.
- I have searched the issue tracker for a bug report that matches the one I want to file, without success.
Electron Version
42.8.1 (also 42.10.0 and 43.5.1; fixed in 44.0.0)
What operating system(s) are you using?
macOS
Operating System Version
macOS 27.0 (26A5425a); also reproduced on macOS 15 and 26 by other users
What arch are you using?
arm64 (including Apple Silicon)
Last Known Working Electron version
34.x (Chromium 132) for the line range; the line number has been wrong for longer
Does the issue also appear in Chromium / Google Chrome?
No
Expected Behavior
With VoiceOver and a Braille display, moving the caret with Up/Down Arrow or Return in a multi-line text field (<textarea> or div[role=textbox]) shows the current line on the Braille display, starting at its first character.
Through the macOS Accessibility API: AXLineForIndex(caret) returns the line containing the caret, and AXRangeForLine(n) returns the range of line n for every line.
Actual Behavior
The Braille display shows the previous line joined to the current one, keeps showing the old line, or goes blank. Only the first line of the field is ever shown correctly. This makes Electron apps unusable with a Braille display on macOS (for example VS Code, see microsoft/vscode#319725 and microsoft/vscode#316018).
Through the macOS Accessibility API, unless the caret is at the very start of a line, AXLineForIndex returns the next line's number and AXRangeForLine returns nothing for every line except line 0.
This is the bug from #47393, which was closed as upstream. The upstream fix has landed: https://crbug.com/423048796, Chromium commit 36ac8f31796a392340f7914d1018c3a885fc183f (https://chromium-review.googlesource.com/c/chromium/src/+/8092671), first shipped in Chromium 152 (Electron 44). Neither 42-x-y nor 43-x-y carries it. Request: backport that commit to 42-x-y and 43-x-y.
Testcase Gist URL
Additional Information
The gist above is the Fiddle from #47393 and reproduces this exact bug. Any multi-line text field shows it.
In-depth investigation
Same test page, same VoiceOver, same Braille display, queried through the macOS Accessibility API with the caret in the middle of line 2 of a three-line text.
Electron 42.8.1 / Chromium 148 (VS Code 1.135):
AXValue: "This is test line 1\nThis is test line 2\nThis is test line 3"
AXSelectedTextRange: {25, 0}
AXInsertionPointLineNumber: 1 (correct, 0-based)
AXLineForIndex(25) = 2 (wrong: one line too far)
AXRangeForLine(0) = {0, 20} "This is test line 1\n"
AXRangeForLine(1), AXRangeForLine(2): no result
AXLineForIndex for every index: 0:0 1:1 ... 19:1 20:1 21:2 ... 40:2 41:3 ... 58:3
Google Chrome 152.0.7977.66 (contains the fix):
AXValue: "This is line 1\nThis is line 2\nThis is line 3"
AXSelectedTextRange: {20, 0}
AXInsertionPointLineNumber: 1
AXLineForIndex(20) = 1 (correct)
AXRangeForLine(0) = {0, 15} "This is line 1\n"
AXRangeForLine(1) = {15, 15} "This is line 2\n"
AXRangeForLine(2) = {30, 14} "This is line 3"
AXLineForIndex for every index: 0:0 1:0 ... 14:0 15:1 ... 29:1 30:2 ... 43:2
Cause, from the Chromium sources at the revisions Electron ships:
ui/accessibility/platform/browser_accessibility_cocoa.mm,accessibilityLineForIndex:usedstd::lower_boundoverkLineStarts(which includes offset 0), so every index that is not exactly a line start maps to the following line. The fix usesupper_boundminus one with bounds checks.ui/accessibility/platform/ax_platform_node_cocoa.mm,AXRangeForLine:(the legacy parameterized-attribute path, which is still the active one becausekMacAccessibilityAPIMigrationis disabled by default) returned nil for any line index other than 0 since the migration change in Chromium 134 (Electron 35). The fix forwards every line index toaccessibilityRangeForLine:.- The upstream commit is small and self-contained (two files plus a test), so it should backport cleanly to 42-x-y and 43-x-y.
Activity
github-actions commentedon Sep 2, 2026
Hello @robin24. Thanks for taking the time to open an issue and helping to make Electron better!
This issue was automatically closed because its body does not follow any of this repository's issue templates. Maintainers rely on the sections in those templates to triage issues, and issues that are missing them usually cannot be acted upon.
To get this issue triaged, please either:
MarshallOfSound commentedon Sep 2, 2026
I can look at backporting to 43, 42-x-y is in security-fix-only state right now
MarshallOfSound commentedon Sep 3, 2026
Done in #53428