Skip to content

Add long-press-move support for text fields 2 - #28242

Merged
xster merged 7 commits into
flutter:masterfrom
xster:rework-long-press-drag
Feb 25, 2019
Merged

xster merged 7 commits into
flutter:masterfrom
xster:rework-long-press-drag

Conversation

@xster

@xster xster commented Feb 21, 2019 •

Copy link
Copy Markdown
Member

Description

This is a retake of #26001

Allows the long press gesture to move after being accepted.

Use on iOS to move text field cursor. Use on Android to expand selections of words on text fields.

Left #26394 for Android

Related Issues

Fixes #20693.

Checklist

Before you create this PR confirm that it meets all requirements listed below
by checking the relevant checkboxes ([x]). This will ensure a smooth and quick
review process.

  • I read the Contributor Guide and followed the process outlined there for
    submitting PRs.
  • My PR includes tests for all changed/updated/fixed behaviors (See
    Test Coverage).
  • All existing and new tests are passing.
  • I updated/added relevant documentation (doc comments with ///).
  • The analyzer (flutter analyze --flutter-repo) does not report any
    problems on my PR.
  • I read and followed the Flutter Style Guide, including
    Features we expect every widget to implement.
  • I signed the CLA.
  • I am willing to follow-up on review comments in a timely manner.

Breaking Change

Does your PR require Flutter developers to manually update their apps
to accommodate your change?

LongPressGestureRecognizers will start to emit onLongPressUp even after the gesture moved after the long press is accepted by default unless a different postAcceptSlopTolerance value is given in the constructor.

@xster
xster requested review from Hixie and goderbauer February 21, 2019 02:39
@zoechi zoechi added a: text input Entering text in a text field or keyboard related problems framework flutter/packages/flutter repository. See also f: labels. p: material_ui material_ui package in flutter/packages p: cupertino_ui cupertino_ui package in flutter/packages f: gestures flutter/packages/flutter/gestures repository. labels Feb 21, 2019
@xster
xster force-pushed the rework-long-press-drag branch from 5bd41fc to c567df0 Compare February 21, 2019 19:20

@goderbauer goderbauer left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

First pass-through with just some nits.

This should probably get the label "API break". Did you already send out communications regarding this break?

Comment thread packages/flutter/lib/src/gestures/long_press.dart
Comment thread packages/flutter/lib/src/gestures/long_press.dart Outdated
Comment thread packages/flutter/lib/src/gestures/long_press.dart
Comment thread packages/flutter/lib/src/gestures/long_press.dart Outdated
Comment thread packages/flutter/lib/src/gestures/long_press.dart Outdated
Comment thread packages/flutter/lib/src/widgets/gesture_detector.dart Outdated
Comment thread packages/flutter/lib/src/rendering/editable.dart
Comment thread packages/flutter/lib/src/rendering/editable.dart
Comment thread packages/flutter/lib/src/material/text_field.dart Outdated
Comment thread packages/flutter/test/cupertino/text_field_test.dart
@xster xster added the c: API break Backwards-incompatible API changes label Feb 22, 2019

@goderbauer goderbauer left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM if the breaking change has been communicated.

this.onDoubleTap,
this.onLongPress,
this.onLongPressUp,
this.onLongPressStart,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You didn't like this suggestion? :)

@xster
xster merged commit ec00e97 into flutter:master Feb 25, 2019
@xster
xster deleted the rework-long-press-drag branch February 25, 2019 22:34
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Aug 7, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

a: text input Entering text in a text field or keyboard related problems c: API break Backwards-incompatible API changes f: gestures flutter/packages/flutter/gestures repository. framework flutter/packages/flutter repository. See also f: labels. p: cupertino_ui cupertino_ui package in flutter/packages p: material_ui material_ui package in flutter/packages

Projects

None yet

Development

Successfully merging this pull request may close these issues.

It's not possible to move the cursor in a text field by dragging

4 participants