Remove mouse tap text drag selection throttling to improve responsiveness (#123460)
Remove mouse tap text drag selection throttling to improve responsiveness
This commit is contained in:
@@ -794,10 +794,6 @@ sealed class BaseTapAndDragGestureRecognizer extends OneSequenceGestureRecognize
|
||||
/// The frequency at which the [onDragUpdate] callback is called.
|
||||
///
|
||||
/// 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;
|
||||
|
||||
/// An upper bound for the amount of taps that can belong to one tap series.
|
||||
|
||||
@@ -32,10 +32,6 @@ import 'transitions.dart';
|
||||
export 'package:flutter/rendering.dart' show TextSelectionPoint;
|
||||
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
|
||||
/// child.
|
||||
///
|
||||
@@ -2953,10 +2949,6 @@ class TextSelectionGestureDetector extends StatefulWidget {
|
||||
final GestureTapDragStartCallback? onDragSelectionStart;
|
||||
|
||||
/// 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;
|
||||
|
||||
/// Called when a mouse that was previously dragging is released.
|
||||
@@ -3123,7 +3115,6 @@ class _TextSelectionGestureDetectorState extends State<TextSelectionGestureDetec
|
||||
// Text selection should start from the position of the first pointer
|
||||
// down event.
|
||||
..dragStartBehavior = DragStartBehavior.down
|
||||
..dragUpdateThrottleFrequency = _kDragSelectionUpdateThrottle
|
||||
..onTapDown = _handleTapDown
|
||||
..onDragStart = _handleDragStart
|
||||
..onDragUpdate = _handleDragUpdate
|
||||
@@ -3142,7 +3133,6 @@ class _TextSelectionGestureDetectorState extends State<TextSelectionGestureDetec
|
||||
// Text selection should start from the position of the first pointer
|
||||
// down event.
|
||||
..dragStartBehavior = DragStartBehavior.down
|
||||
..dragUpdateThrottleFrequency = _kDragSelectionUpdateThrottle
|
||||
..onTapDown = _handleTapDown
|
||||
..onDragStart = _handleDragStart
|
||||
..onDragUpdate = _handleDragUpdate
|
||||
|
||||
Reference in New Issue
Block a user