New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Text handle drag swap on Apple platforms #105069
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you swap the handles, the same gesture recognizer callback is still registered to the same handle under the touch point is it?
// On Apple platforms, dragging the base handle makes it the extent. | ||
case TargetPlatform.iOS: | ||
case TargetPlatform.macOS: | ||
final int endOffset = math.max( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: _selection.end
?
I'm going to double check that the correct callbacks are called when I'm at home where my Mac is. |
98c6e71
to
c7b4ea6
Compare
c7b4ea6
to
53dd9fd
Compare
The callbacks were correct; the left handle is always the "start" handle and the right handle is always the "end", regardless of whether they represent the base or offset. However, I was missing a case where the handles were already reversed before the drag started. I also added on to the test to cover that case. |
Dragging the base text selection handle on Apple makes it the extent.
On iOS, dragging the base handle causes it to become the extent handle, so that subsequent "shift + arrow key" events move the previously dragged handle.
Discovered while working on #102992.
This video shows the correct iOS behavior after this PR.
Screen.Recording.2022-05-31.at.4.02.42.PM.mov