Unverified Commit 6a337a76 authored by stuartmorgan's avatar stuartmorgan Committed by GitHub

Revert "Fix handling backspace on macos with text selection (#49760)" (#51577)

This reverts commit 9375377f.

Fixes #51511
parent 9b4159c5
......@@ -437,17 +437,12 @@ class RenderEditable extends RenderBox with RelayoutWhenSystemFontsChangeMixin {
LogicalKeyboardKey.arrowDown,
};
static final Set<LogicalKeyboardKey> _deleteKeys = <LogicalKeyboardKey>{
LogicalKeyboardKey.delete,
LogicalKeyboardKey.backspace,
};
static final Set<LogicalKeyboardKey> _shortcutKeys = <LogicalKeyboardKey>{
LogicalKeyboardKey.keyA,
LogicalKeyboardKey.keyC,
LogicalKeyboardKey.keyV,
LogicalKeyboardKey.keyX,
..._deleteKeys,
LogicalKeyboardKey.delete,
};
static final Set<LogicalKeyboardKey> _nonModifierKeys = <LogicalKeyboardKey>{
......@@ -502,7 +497,7 @@ class RenderEditable extends RenderBox with RelayoutWhenSystemFontsChangeMixin {
// _handleShortcuts depends on being started in the same stack invocation
// as the _handleKeyEvent method
_handleShortcuts(key);
} else if (_deleteKeys.contains(key)) {
} else if (key == LogicalKeyboardKey.delete) {
_handleDelete();
}
}
......
......@@ -3741,51 +3741,6 @@ void main() {
reason: 'on $platform',
);
expect(controller.text, isEmpty, reason: 'on $platform');
/// Paste and Select All
await sendKeys(
tester,
<LogicalKeyboardKey>[
LogicalKeyboardKey.keyV,
LogicalKeyboardKey.keyA,
],
shortcutModifier: true,
platform: platform,
);
expect(
selection,
equals(
const TextSelection(
baseOffset: 0,
extentOffset: testText.length,
affinity: TextAffinity.downstream,
),
),
reason: 'on $platform',
);
expect(controller.text, equals(testText), reason: 'on $platform');
// Backspace
await sendKeys(
tester,
<LogicalKeyboardKey>[
LogicalKeyboardKey.delete,
],
platform: platform,
);
expect(
selection,
equals(
const TextSelection(
baseOffset: 0,
extentOffset: 72,
affinity: TextAffinity.downstream,
),
),
reason: 'on $platform',
);
expect(controller.text, isEmpty, reason: 'on $platform');
}
testWidgets('keyboard text selection works as expected on linux', (WidgetTester tester) async {
......
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