Skip to content

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

Closed

Description

@justinmc

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

Activity

  1. added
    platform-iosiOS applications specifically
    frameworkflutter/packages/flutter repository. See also f: labels.
    p: cupertino_uicupertino_ui package in flutter/packages
    on Jun 24, 2019
  2. justinmc commented on Jun 24, 2019

    @justinmc
    ContributorAuthor

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

  3. added
    e: OS-version specificAffects only some versions of the relevant operating system
    c: new featureNothing broken; request for a new capability
    and removed
    e: OS-version specificAffects only some versions of the relevant operating system
    on Mar 13, 2020
  4. added
    customer: crowdAffects or could affect many people, though not necessarily a specific customer.
    on Mar 26, 2020
  5. xster commented on Apr 30, 2020

    @xster
    Member

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

  6. xster commented on Sep 30, 2020

    @xster
    Member

    @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(
    .

  7. xster commented on Dec 10, 2020

    @xster
    Member

    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?

  8. DanielEdrisian commented on Dec 10, 2020

    @DanielEdrisian
    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.

  9. xster commented on Dec 10, 2020

    @xster
    Member

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

  10. github-actions commented on Apr 12, 2023

    @github-actions

    This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

  11. locked as resolved and limited conversation to collaborators on Apr 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

a: fidelityMatching the OEM platforms betterc: new featureNothing broken; request for a new capabilitycustomer: crowdAffects or could affect many people, though not necessarily a specific customer.frameworkflutter/packages/flutter repository. See also f: labels.p: cupertino_uicupertino_ui package in flutter/packagesplatform-iosiOS applications specifically

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions