From 052dea3003b393d2ebb6754d0ed2fd7329cd8d26 Mon Sep 17 00:00:00 2001 From: Samuel Nevala <samuel.nevala@digia.com> Date: Tue, 21 Oct 2014 16:32:21 +0300 Subject: [PATCH] Placeholder text in TextField disappears on TextField tap. Instead of TextInput.inputMethodComposingtext and TextInput.text.length use TextInput.displayText.length to determine if placeholder should be visible. Task-number: QTBUG-40534 Change-Id: I0de2cb65c7c59d54365172b9233a5aba0f067ff5 Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com> --- src/controls/TextField.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/controls/TextField.qml b/src/controls/TextField.qml index 3d31162c4..a7aa67eb7 100644 --- a/src/controls/TextField.qml +++ b/src/controls/TextField.qml @@ -619,7 +619,7 @@ Control { font: textInput.font horizontalAlignment: textInput.horizontalAlignment verticalAlignment: textInput.verticalAlignment - opacity: !textInput.text.length && !textInput.inputMethodComposing ? 1 : 0 + opacity: textInput.displayText.length ? 0.0 : 1.0 color: __panel ? __panel.placeholderTextColor : "darkgray" clip: contentWidth > width; elide: Text.ElideRight -- GitLab