Text handle drag swap on Apple platforms#105069
Conversation
LongCatIsLooong
left a comment
There was a problem hiding this comment.
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.
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