Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 84c4b08b authored by George Mount's avatar George Mount Committed by Android (Google) Code Review
Browse files

Merge changes Ia5729aaf,I91584b7d into jb-dev

* changes:
  Remove selection highlight when replacing/deleting.
  Don't do character add/delete when there is a selection.
parents 93e3bf12 c4c3bc9b
Loading
Loading
Loading
Loading
+13 −8
Original line number Diff line number Diff line
@@ -431,6 +431,9 @@ public final class WebViewClassic implements WebViewProvider, WebViewProvider.Sc
            boolean isCharacterDelete = false;
            int textLength = text.length();
            int originalLength = original.length();
            int selectionStart = Selection.getSelectionStart(editable);
            int selectionEnd = Selection.getSelectionEnd(editable);
            if (selectionStart == selectionEnd) {
                if (textLength > originalLength) {
                    isCharacterAdd = (textLength == originalLength + 1)
                            && TextUtils.regionMatches(text, 0, original, 0,
@@ -440,6 +443,7 @@ public final class WebViewClassic implements WebViewProvider, WebViewProvider.Sc
                            && TextUtils.regionMatches(text, 0, original, 0,
                                    textLength);
                }
            }
            if (isCharacterAdd) {
                sendCharacter(text.charAt(textLength - 1));
            } else if (isCharacterDelete) {
@@ -7481,6 +7485,7 @@ public final class WebViewClassic implements WebViewProvider, WebViewProvider.Sc
                    int cursorPosition = start + text.length();
                    replaceTextfieldText(start, end, text,
                            cursorPosition, cursorPosition);
                    selectionDone();
                    break;
                }