This reverts commit 9375377fa99e8faae8a573e9fe92b8712d33e82d. Fixes #51511
This commit is contained in:
parent
9b4159c5ee
commit
6a337a76dd
@ -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 {
|
||||
|
Loading…
x
Reference in New Issue
Block a user