changeset 5616:5e8a8d2136eb

RT-16711: TextField/TextArea, need to type "Backspace" key twice to delete the last character of the composing text. Reviewed-by: naoto
author leifs
date Fri, 01 Nov 2013 17:15:43 -0700
parents 94ba02ca4154
children 3772b13b9c98
files modules/controls/src/main/java/com/sun/javafx/scene/control/skin/TextInputControlSkin.java
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/modules/controls/src/main/java/com/sun/javafx/scene/control/skin/TextInputControlSkin.java	Fri Nov 01 16:47:21 2013 -0700
+++ b/modules/controls/src/main/java/com/sun/javafx/scene/control/skin/TextInputControlSkin.java	Fri Nov 01 17:15:43 2013 -0700
@@ -494,15 +494,15 @@
                 textInput.replaceText(textInput.getSelection(), committed);
             }
 
-            // Insert composed text
+            // Replace composed text
             imstart = textInput.getSelection().getStart();
             StringBuilder composed = new StringBuilder();
             for (InputMethodTextRun run : event.getComposed()) {
                 composed.append(run.getText());
             }
+            textInput.replaceText(textInput.getSelection(), composed.toString());
             imlength = composed.length();
             if (imlength != 0) {
-                textInput.replaceText(textInput.getSelection(), composed.toString());
                 int pos = imstart;
                 for (InputMethodTextRun run : event.getComposed()) {
                     int endPos = pos + run.getText().length();