Skip to content
This repository has been archived by the owner on Jul 22, 2024. It is now read-only.

Commit

Permalink
Position the caret at the start position after cutting the text (#2668)
Browse files Browse the repository at this point in the history
  • Loading branch information
keianhzo authored and bluemarvin committed Jan 23, 2020
1 parent bf1c535 commit 225bc55
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -608,6 +608,8 @@ public void onAction(String action) {
String selectedText = mBinding.urlEditText.getText().toString().substring(startSelection, endSelection);
clipboard.setPrimaryClip(ClipData.newPlainText("text", selectedText));
mBinding.urlEditText.setText(StringUtils.removeRange(mBinding.urlEditText.getText().toString(), startSelection, endSelection));
mBinding.urlEditText.setSelection(startSelection);

} else if (action.equals(GeckoSession.SelectionActionDelegate.ACTION_COPY) && selectionValid) {
String selectedText = mBinding.urlEditText.getText().toString().substring(startSelection, endSelection);
clipboard.setPrimaryClip(ClipData.newPlainText("text", selectedText));
Expand Down

0 comments on commit 225bc55

Please sign in to comment.