Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -326,13 +326,6 @@ public boolean handleKeyEvent(KeyEvent event) {
return true;
}
}
if (event.getAction() == KeyEvent.ACTION_UP
&& (event.getKeyCode() == KeyEvent.KEYCODE_SHIFT_LEFT
|| event.getKeyCode() == KeyEvent.KEYCODE_SHIFT_RIGHT)) {
int selEnd = Selection.getSelectionEnd(mEditable);
setSelection(selEnd, selEnd);
return true;
}
return false;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -551,7 +551,8 @@ public void testPerformPrivateCommand_dataIsFloatArray() throws JSONException {
}

@Test
public void testSendKeyEvent_shiftKeyUpCancelsSelection() {
public void testSendKeyEvent_shiftKeyUpDoesNotCancelSelection() {
// Regression test for https://github.com/flutter/flutter/issues/101569.
int selStart = 5;
int selEnd = 10;
ListenableEditingState editable = sampleEditable(selStart, selEnd);
Expand All @@ -560,8 +561,8 @@ public void testSendKeyEvent_shiftKeyUpCancelsSelection() {
KeyEvent shiftKeyUp = new KeyEvent(KeyEvent.ACTION_UP, KeyEvent.KEYCODE_SHIFT_LEFT);
boolean didConsume = adaptor.handleKeyEvent(shiftKeyUp);

assertTrue(didConsume);
assertEquals(selEnd, Selection.getSelectionStart(editable));
assertFalse(didConsume);
assertEquals(selStart, Selection.getSelectionStart(editable));
assertEquals(selEnd, Selection.getSelectionEnd(editable));
}

Expand Down