feedback-assistant / reports

Open collection of Apple Feedback Assistant reports
230 stars 2 forks source link

FB9114768: kAXLineForIndexParameterizedAttribute returns wrong line number in some cases on Big Sur #311

Open godbout opened 2 years ago

godbout commented 2 years ago

Description

i have the following text:

this is another text helloh yes

if the caret is at the beginning of the second line, before the first h of "helloh", and with 1 character selected (the first h), Big Sur returns the line range as 0, 21 rather than 21, 28.

it works fine if there is no character selected. it works fine also up to Catalina. the issue seems to appear only in Big Sur.

godbout commented 2 years ago

some apps fail while some apps work. in my UI Tests i was surprised to see that it was still failing even when i was not selecting a character. on Big Sur my mock Window is a new SwiftUI TextEditor, while on Catalina i use a NSTextView. NSTextView sends back the correct line number, while the new TextEditor do not!

godbout commented 2 years ago

apologies. my bad. it still does fail with the NSTextView.

godbout commented 2 years ago

i'm submitting a video to show the issue. i dump 4 times the line range for an index. 2 times in Xcode, 2 times in TextEdit. the second time in TextEdit, the line range is wrong. the first time is without selecting, the second time is while selecting.

Files

https://user-images.githubusercontent.com/121373/170824467-a26c9077-5c1a-46aa-a495-3a446af3851f.mp4

godbout commented 2 years ago

adding a new video, showing the first character of the line sending back wrong line number when selected

Files

https://user-images.githubusercontent.com/121373/170824544-270161e1-fa75-4889-8bd1-3ac47f0a9348.mp4

godbout commented 2 years ago

i've created a minimal repository to show the issue: https://github.com/godbout/ax-api-big-sur-bug

godbout commented 2 years ago

when select the first character of the line with the keyboard, the value returned by the AX API is correct. but when selected via mouse, trackpad, or if the text selection has been made through the AX API, then it is wrong.

godbout commented 2 weeks ago

still failing up to macOS Sequoia, 15.1.