Unverified Commit 5eb236c3 authored by Loune Lam's avatar Loune Lam Committed by GitHub

Remove mouse tap text drag selection throttling to improve responsiveness (#123460)

Remove mouse tap text drag selection throttling to improve responsiveness
parent efb8b38d
...@@ -794,10 +794,6 @@ sealed class BaseTapAndDragGestureRecognizer extends OneSequenceGestureRecognize ...@@ -794,10 +794,6 @@ sealed class BaseTapAndDragGestureRecognizer extends OneSequenceGestureRecognize
/// The frequency at which the [onDragUpdate] callback is called. /// The frequency at which the [onDragUpdate] callback is called.
/// ///
/// The value defaults to null, meaning there is no delay for [onDragUpdate] callback. /// The value defaults to null, meaning there is no delay for [onDragUpdate] callback.
///
/// See also:
/// * [TextSelectionGestureDetector], which uses this parameter to avoid excessive updates
/// text layouts in text fields.
Duration? dragUpdateThrottleFrequency; Duration? dragUpdateThrottleFrequency;
/// An upper bound for the amount of taps that can belong to one tap series. /// An upper bound for the amount of taps that can belong to one tap series.
......
...@@ -32,10 +32,6 @@ import 'transitions.dart'; ...@@ -32,10 +32,6 @@ import 'transitions.dart';
export 'package:flutter/rendering.dart' show TextSelectionPoint; export 'package:flutter/rendering.dart' show TextSelectionPoint;
export 'package:flutter/services.dart' show TextSelectionDelegate; export 'package:flutter/services.dart' show TextSelectionDelegate;
/// A duration that controls how often the drag selection update callback is
/// called.
const Duration _kDragSelectionUpdateThrottle = Duration(milliseconds: 50);
/// The type for a Function that builds a toolbar's container with the given /// The type for a Function that builds a toolbar's container with the given
/// child. /// child.
/// ///
...@@ -2953,10 +2949,6 @@ class TextSelectionGestureDetector extends StatefulWidget { ...@@ -2953,10 +2949,6 @@ class TextSelectionGestureDetector extends StatefulWidget {
final GestureTapDragStartCallback? onDragSelectionStart; final GestureTapDragStartCallback? onDragSelectionStart;
/// Called repeatedly as a mouse moves while dragging. /// Called repeatedly as a mouse moves while dragging.
///
/// The frequency of calls is throttled to avoid excessive text layout
/// operations in text fields. The throttling is controlled by the constant
/// [_kDragSelectionUpdateThrottle].
final GestureTapDragUpdateCallback? onDragSelectionUpdate; final GestureTapDragUpdateCallback? onDragSelectionUpdate;
/// Called when a mouse that was previously dragging is released. /// Called when a mouse that was previously dragging is released.
...@@ -3123,7 +3115,6 @@ class _TextSelectionGestureDetectorState extends State<TextSelectionGestureDetec ...@@ -3123,7 +3115,6 @@ class _TextSelectionGestureDetectorState extends State<TextSelectionGestureDetec
// Text selection should start from the position of the first pointer // Text selection should start from the position of the first pointer
// down event. // down event.
..dragStartBehavior = DragStartBehavior.down ..dragStartBehavior = DragStartBehavior.down
..dragUpdateThrottleFrequency = _kDragSelectionUpdateThrottle
..onTapDown = _handleTapDown ..onTapDown = _handleTapDown
..onDragStart = _handleDragStart ..onDragStart = _handleDragStart
..onDragUpdate = _handleDragUpdate ..onDragUpdate = _handleDragUpdate
...@@ -3142,7 +3133,6 @@ class _TextSelectionGestureDetectorState extends State<TextSelectionGestureDetec ...@@ -3142,7 +3133,6 @@ class _TextSelectionGestureDetectorState extends State<TextSelectionGestureDetec
// Text selection should start from the position of the first pointer // Text selection should start from the position of the first pointer
// down event. // down event.
..dragStartBehavior = DragStartBehavior.down ..dragStartBehavior = DragStartBehavior.down
..dragUpdateThrottleFrequency = _kDragSelectionUpdateThrottle
..onTapDown = _handleTapDown ..onTapDown = _handleTapDown
..onDragStart = _handleDragStart ..onDragStart = _handleDragStart
..onDragUpdate = _handleDragUpdate ..onDragUpdate = _handleDragUpdate
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment