WWW update
[ubi] / qml / ubi / components / TextField.qml
index b13ab84..966e9f2 100644 (file)
@@ -16,6 +16,11 @@ Rectangle {
     border.width: 3
     border.color: input.activeFocus ? "black" : "grey"
 
+    function closeSoftwareInputPanel() {
+        input.focus = false;
+        input.closeSoftwareInputPanel();
+    }
+
     TextInput {
         id: input
 
@@ -24,10 +29,20 @@ Rectangle {
         selectByMouse: true
         selectionColor: "gray"
         onTextChanged: root.textChanged()
+        //focus: true
+
+        Keys.onPressed: {
+            if (event.key == Qt.Key_Enter || event.key == Qt.Key_Return) {
+                closeSoftwareInputPanel();
+                focus = false;
+                dummy.focus = true;
+            }
+        }
 
-        Keys.onReturnPressed: {
-            closeSoftwareInputPanel()
-            dummy.focus = true
+        onFocusChanged: {
+            if(focus == false) {
+                closeSoftwareInputPanel();
+            }
         }
 
     }