Skip to content
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

[iOS 13] Long press and drag to select #35010

Closed
justinmc opened this issue Jun 24, 2019 · 6 comments · Fixed by #123630
Closed

[iOS 13] Long press and drag to select #35010

justinmc opened this issue Jun 24, 2019 · 6 comments · Fixed by #123630
Assignees
Labels
a: fidelity Matching the OEM platforms better. customer: crowd Affects or could affect many people, though not necessarily a specific customer. f: cupertino flutter/packages/flutter/cupertino repository. framework flutter/packages/flutter repository. See also f: labels. new feature Nothing broken; request for a new capability. platform-ios iOS applications specifically.

Comments

@justinmc
Copy link
Contributor

In iOS 13, long pressing on editable and non-editable text starts selecting. Dragging extends the selection. I think this is identical to Android now, so it should be easy for Flutter to support. Previously, long pressing and dragging on text set the cursor and showed the loupe magnifying glass.

This was shown at WWDC in this video around the 30:00 mark. I also confirmed this in the iOS 13 simulator.

long_press

@justinmc justinmc added platform-ios iOS applications specifically. framework flutter/packages/flutter repository. See also f: labels. f: cupertino flutter/packages/flutter/cupertino repository. labels Jun 24, 2019
@justinmc
Copy link
Contributor Author

Tapping and dragging without waiting for a long press still drags the cursor around.

@TahaTesser TahaTesser added e: OS Version specific new feature Nothing broken; request for a new capability. and removed e: OS Version specific labels Mar 13, 2020
@iapicca iapicca added the a: fidelity Matching the OEM platforms better. label Mar 16, 2020
@TahaTesser TahaTesser added the customer: crowd Affects or could affect many people, though not necessarily a specific customer. label Mar 26, 2020
@xster
Copy link
Member

xster commented Apr 30, 2020

Seems like the same behavior as Android on #26394 now.

@xster xster moved this from Awaiting triage to Engineer reviewed in iOS Platform - Cupertino widget review Apr 30, 2020
@xster
Copy link
Member

xster commented Sep 30, 2020

@DanielEdrisian here's another one you could give a try. It's slightly more involved than the last one but should still be somewhat straightforward.

We already have some infrastructure to handle various combinations of gestures in textfields. #26001 has some example of the current behavior of long-press-dragging translating to moving a collapsed cursor. It seems like the new behavior is to select the current word and then expand the selection by letters.

Part of the plumbing goes through

void _handleLongPressMoveUpdate(LongPressMoveUpdateDetails details) {
which lets widgets customize what happens on onSingleLongTapMoveUpdate.

You can get some ideas for possible options such as

renderEditable.selectWordsInRange(
.

@xster
Copy link
Member

xster commented Dec 10, 2020

I just double checked quickly but it seems unfortunately like the premise of the bug isn't correct anymore on the latest iOS version

On long-press-drag:
Kapture 2020-12-10 at 9 45 30

On double-tap-drag:
Kapture 2020-12-10 at 9 46 15

It seems like the default iOS behavior was closer to our current implementation now (though the long-press-drag now shows the cursor not bound to the textfield itself like the keyboard force-touch-press-drag magnifier). Did I hold it right?

@DanielEdrisian
Copy link
Contributor

@xster I believe when the text isn't focused, long press and drag does text selection. Once it has focus it only selects a range in double tap drag.

@xster
Copy link
Member

xster commented Dec 10, 2020

Spoke offline. @DanielEdrisian is correct, it's different when focused vs non-focused.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a: fidelity Matching the OEM platforms better. customer: crowd Affects or could affect many people, though not necessarily a specific customer. f: cupertino flutter/packages/flutter/cupertino repository. framework flutter/packages/flutter repository. See also f: labels. new feature Nothing broken; request for a new capability. platform-ios iOS applications specifically.
Projects
Development

Successfully merging a pull request may close this issue.

5 participants