From f720242419cd73529277173e43e9f7a8ed367ad3 Mon Sep 17 00:00:00 2001 From: Venugopal Shivashankar Date: Fri, 7 Oct 2016 15:20:26 +0200 Subject: Example: Use TextInput's displayText property instead of length The replace Text item that is overlayed on the TextInput, behaves like the TextField.placeholderText property. The opacity of the item varies based on whether the TextInput has any text or not. Using the length property to adjust the opacity fails on platforms such as Android where the length is not updated until the text is committed (i.e. until you hit the [ENTER] key). Whereas the displayText property is updated when you key in text, so it is ideal to use the length of the displayText than the length property itself. Change-Id: I678e5db5e5d5027e4aae816b6620095c68138eb7 Reviewed-by: Shawn Rutledge --- examples/quick/demos/tweetsearch/content/LineInput.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'examples/quick/demos/tweetsearch/content/LineInput.qml') diff --git a/examples/quick/demos/tweetsearch/content/LineInput.qml b/examples/quick/demos/tweetsearch/content/LineInput.qml index 7e4ffda92b..46bc73f3af 100644 --- a/examples/quick/demos/tweetsearch/content/LineInput.qml +++ b/examples/quick/demos/tweetsearch/content/LineInput.qml @@ -62,7 +62,7 @@ FocusScope { text: "Enter word" font.pixelSize: 18 color: "#707070" - opacity: input.length ? 0 : 1 + opacity: input.displayText.length ? 0 : 1 } Text { -- cgit v1.2.3