You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[CP-Stable] Fix BaseTapAndDragGestureRecognizer drag state after losing gesture arena #153939
Fixes an issue where Flutter TextField may crash on iOS.
Impacted Users
Users of Flutter TextField on iOS, and users of BaseTapAndDragGestureRecognizer with eagerVictoryOnDrag set to false
Impact Description
On debug builds this triggers an assertion when using a TextField on iOS does a horizontal swipe or pan that doesn't meet the drag threshold to win the gesture arena and leaves TextField gestures in a weird state where no other tap gestures are accepted.
Workaround
No workaround, issue is with internal implementation of BaseTapAndDragGestureRecognizer.
Risk
low
Test Coverage
yes
Validation Steps
Run the example below on iOS, tap the TextField to focus it, and then do a horizontal drag somewhere not on the cursor. Then try to tap somewhere else. The cursor should be moved to the word edge closest to the tapped position.
import'package:flutter/material.dart';
voidmain() {
runApp(constMyApp());
}
classMyAppextendsStatefulWidget {
constMyApp({super.key});
@overrideState<MyApp> createState() =>_MyAppState();
}
class_MyAppStateextendsState<MyApp> {
finalTextEditingController _controller =TextEditingController(text:'Some long text that should scroll. '*20);
@overrideWidgetbuild(BuildContext context) {
returnMaterialApp(
debugShowCheckedModeBanner:false,
home:Scaffold(
body:Center(
child:TextField(
controller: _controller,
maxLines:5,
),
),
),
);
}
}
changed the title [-][CP] Fix BaseTapAndDragGestureRecognizer drag state after losing gesture arena[/-][+][CP-Stable] Fix BaseTapAndDragGestureRecognizer drag state after losing gesture arena[/+]on Aug 26, 2024
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.
Activity
[-][CP] Fix BaseTapAndDragGestureRecognizer drag state after losing gesture arena[/-][+][CP-Stable] Fix BaseTapAndDragGestureRecognizer drag state after losing gesture arena[/+][CP-stable] Fix BaseTapAndDragGestureRecognizer should reset drag sta…
[flutter_releases] Flutter stable 3.24.0 Framework Cherrypicks (#154430)
github-actions commentedon Sep 24, 2024
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 -vand a minimal reproduction of the issue.