You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
wrong AX line number and line range (location and length) on macOS using the macOS Accessibility Framework #47393
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
34.0.0
What operating system(s) are you using?
macOS
Operating System Version
macOS Sequoia 15.5 (24F74)
What arch are you using?
arm64 (including Apple Silicon)
Last Known Working Electron version
No response
Expected Behavior
using the macOS Accessibility Framework:
getting the line number should return 0 if on first line, 1 if on second line, 2 if on third line, etc.
getting the line range should return the correct location of the beginning of the line, and the correct line length
Actual Behavior
the line number is only correct if the caret location is at the beginning of a line. if it is anywhere else on that line, the line number is wrong (ends up being the line number of the NEXT line)
the line range is also only correct if the caret location is at the beginning of a line. anywhere else and what we get is the data from the NEXT line
Chrome has its own set of issues. for example on text fields only the line number is wrong. line range is correct, wherever your caret location is. for text areas both line number or line range are incorrect, although the line range issue is different from what i see with Electron. (Chrome it always gives the data from the first line, Electron gives the data from the next line.)
Even though you say it affects all Electron apps, could you please use Electron Fiddle to create a simple example app and publish it from Electron Fiddle as a GitHub gist? Applying the blocked/need-repro label until then.
Hello @godbout. Thanks for reporting this and helping to make Electron better!
Would it be possible for you to make a standalone testcase with only the code necessary to reproduce the issue? For example, Electron Fiddle is a great tool for making small test cases and makes it easy to publish your test case to a gist that Electron maintainers can use.
Stand-alone test cases make fixing issues go more smoothly: it ensure everyone's looking at the same issue, it removes all unnecessary variables from the equation, and it can also provide the basis for automated regression tests.
Now adding the
blocked/need-reproNeeds a test case to reproduce the bug
label for this reason. After you make a test case, please link to it in a followup comment. This issue will be closed in 10 days if the above is not addressed.
Even though you say it affects all Electron apps, could you please use Electron Fiddle to create a simple example app and publish it from Electron Fiddle as a GitHub gist? Applying the blocked/need-repro label until then.
i've used v36.4.0, and although the behavior is still not the one expected, it's now what i'm describing above regarding Chrome. which means the line number is not correct if not on the first character of a line, and line range returned is always the line range from the first line (which, in case of text fields, therefore happens to be correct lol).
thanks for having a look at this, and please lemme know if this should be reported to Chrome/Chromium/Blink also/instead. (although it will affect every Electron app, so i think if it's a Chrome/Chromium/Blink issue you guys should really push for it to be fixed!)
i've used v36.4.0, and although the behavior is still not the one expected, it's now what i'm describing above regarding Chrome.
Thanks for making the gist and testing on v36!
If the behavior is the same as in Chrome, that means that Electron isn't doing anything special here and just inheriting Chromium's behavior. In those cases, there's no Electron-specific code, so the issue needs to be fixed and reported in Chromium.
Please file an issue for this bug in the Chromium issue tracker. Please include the index.html file from the your testcase gist. That will help Chromium developers reproduce the issue (and thus it will increase the chances of it being fixed).
Then please share the link to the Chromium issue here.
Because this is an upstream issue, I'll close this issue in the Electron issue tracker. However, as mentioned, please do report it in the Chromium bug tracker to get it fixed. Thanks!
Activity
codebytere commentedon Jun 6, 2025
@godbout does this also happen with Chrome?
godbout commentedon Jun 6, 2025
Chrome has its own set of issues. for example on text fields only the line number is wrong. line range is correct, wherever your caret location is. for text areas both line number or line range are incorrect, although the line range issue is different from what i see with Electron. (Chrome it always gives the data from the first line, Electron gives the data from the next line.)
nikwen commentedon Jun 6, 2025
Thanks for reporting!
Even though you say it affects all Electron apps, could you please use Electron Fiddle to create a simple example app and publish it from Electron Fiddle as a GitHub gist? Applying the
blocked/need-reprolabel until then.electron-issue-triage commentedon Jun 6, 2025
Hello @godbout. Thanks for reporting this and helping to make Electron better!
Would it be possible for you to make a standalone testcase with only the code necessary to reproduce the issue? For example, Electron Fiddle is a great tool for making small test cases and makes it easy to publish your test case to a gist that Electron maintainers can use.
Stand-alone test cases make fixing issues go more smoothly: it ensure everyone's looking at the same issue, it removes all unnecessary variables from the equation, and it can also provide the basis for automated regression tests.
Now adding the blocked/need-reproNeeds a test case to reproduce the bug
label for this reason. After you make a test case, please link to it in a followup comment. This issue will be closed in 10 days if the above is not addressed.
1 remaining item
godbout commentedon Jun 6, 2025
alright, will try. thanks.
godbout commentedon Jun 6, 2025
@nikwen here you go: https://gist.github.com/godbout/a0cf7b46e4032790bb22281f9cdb39a4
i've used v36.4.0, and although the behavior is still not the one expected, it's now what i'm describing above regarding Chrome. which means the line number is not correct if not on the first character of a line, and line range returned is always the line range from the first line (which, in case of text fields, therefore happens to be correct lol).
thanks for having a look at this, and please lemme know if this should be reported to Chrome/Chromium/Blink also/instead. (although it will affect every Electron app, so i think if it's a Chrome/Chromium/Blink issue you guys should really push for it to be fixed!)
nikwen commentedon Jun 6, 2025
Thanks for making the gist and testing on v36!
If the behavior is the same as in Chrome, that means that Electron isn't doing anything special here and just inheriting Chromium's behavior. In those cases, there's no Electron-specific code, so the issue needs to be fixed and reported in Chromium.
Please file an issue for this bug in the Chromium issue tracker. Please include the
index.htmlfile from the your testcase gist. That will help Chromium developers reproduce the issue (and thus it will increase the chances of it being fixed).Then please share the link to the Chromium issue here.
Because this is an upstream issue, I'll close this issue in the Electron issue tracker. However, as mentioned, please do report it in the Chromium bug tracker to get it fixed. Thanks!
godbout commentedon Jun 7, 2025
as a starter, issue regarding the line number that i reported in 2022: https://issues.chromium.org/issues/40839954
i'll ping them again regarding this. will open a new issue regarding the line range, and will update this issue with a link to the new bug report.
godbout commentedon Jun 7, 2025
new showcase GH repo to make it clear it's a Chromium bug, not an Electron one per se: https://github.com/godbout/AXLineNumberAndLineRangeChromiumBugs
godbout commentedon Jun 7, 2025
new Chromium issue: https://issues.chromium.org/issues/423048796. now time to thoughts and prayers.
godbout commentedon Nov 4, 2026
THIS HAS BEEN FIXED IN CHROMIUM FINALLY AFTER YEARS OF TALK! Osome.