Skip to content

Vertical dragging to select text #28676

Closed

Description

@mdebbar

This PR adds support for text selection by dragging with a mouse. The current implementation only supports horizontal dragging since vertical dragging will most likely conflict with scrolling.

The solution is to make it so that scrolling is only triggered when initiated by touch events, and vertical text selection is only triggered by a mouse. No conflicts!

But with the current state of Flutter, we can't disable mouse-drag-to-scroll yet because there is no other way to scroll on desktop. Once wheel scrolling is fully implemented, we can revisit this.

  • wheel scroll.
  • scroll bars.
  • disable drag-to-scroll when the device is a mouse.
  • enable text selection by dragging in any direction.

Activity

  1. added
    frameworkflutter/packages/flutter repository. See also f: labels.
    f: scrollingViewports, list views, slivers, etc.
    f: gesturesflutter/packages/flutter/gestures repository.
    on Feb 28, 2019
  2. stuartmorgan-g commented on Aug 13, 2019

    @stuartmorgan-g
    Contributor

    Is there work remaining here?

  3. added this to the milestone on Aug 13, 2019
  4. xxgreg commented on Dec 14, 2019

    @xxgreg

    I've run into a similar issue where I'd like to handle a vertical drag, but this isn't possible inside a Scrollable widget as far as I can tell.

    One possible solution is to add an option to Scrollable to disable tap&drag scrolling. Two-finger trackpad and mouse-wheel scrolling would continue to work when this is set.

    My current use case is desktop only. But there's probably a more general solution here, which would set the Scrollable option automatically based on the current platform.

  5. timsneath commented on Jan 2, 2020

    @timsneath

    Pinging @mdebbar to check whether this issue is still relevant?

  6. mdebbar commented on Jan 2, 2020

    @mdebbar
    ContributorAuthor

    @timsneath I added checkboxes in the issue description to clarify which parts are done and which ones are still missing.

  7. timsneath commented on Jan 3, 2020

    @timsneath

    Great - thanks!

  8. added
    has reproducible stepsThe issue has been confirmed reproducible and is ready to work on
    platform-webWeb applications specifically
    on Apr 22, 2020
  9. added
    P2Important issues not at the top of the work list
    on May 29, 2020
  10. added
    P3Issues that are less important to the Flutter project
    and removed
    P2Important issues not at the top of the work list
    on Jun 16, 2020
  11. added
    c: proposalA detailed proposal for a change to Flutter
    and removed
    has reproducible stepsThe issue has been confirmed reproducible and is ready to work on
    on Jul 31, 2020
  12. removed this from the milestone on Aug 17, 2020
  13. mdebbar commented on Dec 7, 2020

    @mdebbar
    ContributorAuthor

    The only piece of work left here is tracked in: #71322

  14. kevlar700 commented on Mar 5, 2021

    @kevlar700

    I believe that this isn't quite complete. Selecting text and dragging above the screen should cause scrolling and more selection?

    Shouldn't arrow keys and page down/up also work by default?

  15. github-actions commented on Aug 3, 2021

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

  16. locked as resolved and limited conversation to collaborators on Aug 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Issues that are less important to the Flutter projecta: desktopRunning on desktopc: proposalA detailed proposal for a change to Flutterf: gesturesflutter/packages/flutter/gestures repository.f: scrollingViewports, list views, slivers, etc.frameworkflutter/packages/flutter repository. See also f: labels.platform-webWeb applications specifically

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions