&& textArea.isEditable()) {
int index = textArea.getSelectionStart();
if (index < textArea.getCharacterCount()) {
int count = Math.max(textArea.getSelectionLength(), 1);
textArea.removeText(index, count);
consumed = true;
}
} else if (keyCode == Keyboard.KeyCode.BACKSPACE
&& textArea.isEditable()) {