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

Commit 5d09bf69 authored by George Mount's avatar George Mount
Browse files

Don't do character add/delete when there is a selection.

 Bug 6506644

Change-Id: I91584b7df23951bc5e735b25161ed6e0bcdbc2b7
parent 4441a369
Loading
Loading
Loading
Loading
+12 −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) {