Skip to content

Commit 006ca6a

Browse files
Revert "Dismiss text selection toolbar with ESC (#98511)"
This reverts commit 9407700.
1 parent 919d205 commit 006ca6a

File tree

2 files changed

+0
-36
lines changed

2 files changed

+0
-36
lines changed

packages/flutter/lib/src/widgets/editable_text.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3150,7 +3150,6 @@ class EditableTextState extends State<EditableText> with AutomaticKeepAliveClien
31503150
ReplaceTextIntent: _replaceTextAction,
31513151
UpdateSelectionIntent: _updateSelectionAction,
31523152
DirectionalFocusIntent: DirectionalFocusAction.forTextField(),
3153-
DismissIntent: CallbackAction<DismissIntent>(onInvoke: (_) => hideToolbar(false)),
31543153

31553154
// Delete
31563155
DeleteCharacterIntent: _makeOverridable(_DeleteTextAction<DeleteCharacterIntent>(this, _characterBoundary)),

packages/flutter/test/widgets/editable_text_test.dart

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1316,41 +1316,6 @@ void main() {
13161316
expect(find.text('Paste'), kIsWeb ? findsNothing : findsOneWidget);
13171317
});
13181318

1319-
testWidgets('can hide toolbar with DismissIntent', (WidgetTester tester) async {
1320-
await tester.pumpWidget(
1321-
MaterialApp(
1322-
home: EditableText(
1323-
backgroundCursorColor: Colors.grey,
1324-
controller: controller,
1325-
focusNode: focusNode,
1326-
style: textStyle,
1327-
cursorColor: cursorColor,
1328-
selectionControls: materialTextSelectionControls,
1329-
),
1330-
),
1331-
);
1332-
1333-
final EditableTextState state =
1334-
tester.state<EditableTextState>(find.byType(EditableText));
1335-
1336-
// Show the toolbar
1337-
state.renderEditable.selectWordsInRange(
1338-
from: Offset.zero,
1339-
cause: SelectionChangedCause.tap,
1340-
);
1341-
await tester.pump();
1342-
1343-
// On web, we don't let Flutter show the toolbar.
1344-
expect(state.showToolbar(), kIsWeb ? isFalse : isTrue);
1345-
await tester.pumpAndSettle();
1346-
expect(find.text('Paste'), kIsWeb ? findsNothing : findsOneWidget);
1347-
1348-
// Hide the menu using the DismissIntent.
1349-
await tester.sendKeyEvent(LogicalKeyboardKey.escape);
1350-
await tester.pump();
1351-
expect(find.text('Paste'), findsNothing);
1352-
});
1353-
13541319
testWidgets('Paste is shown only when there is something to paste', (WidgetTester tester) async {
13551320
await tester.pumpWidget(
13561321
MaterialApp(

0 commit comments

Comments
 (0)