summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorVenugopal Shivashankar <Venugopal.Shivashankar@qt.io>2016-10-07 15:20:26 +0200
committerVenugopal Shivashankar <Venugopal.Shivashankar@qt.io>2016-10-13 10:50:46 +0000
commitf720242419cd73529277173e43e9f7a8ed367ad3 (patch)
treee68549b1bed49cd34f4e0ce96e3a6ccb81bbc9bc /examples
parent9d2169a2d8b81b8707b20ab892550f4a55c07feb (diff)
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 <shawn.rutledge@qt.io>
Diffstat (limited to 'examples')
-rw-r--r--examples/quick/demos/tweetsearch/content/LineInput.qml2
1 files changed, 1 insertions, 1 deletions
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 {