<div dir="ltr"><div>hi,<br></div><div>I think this is an event loop issue, your event get in the middle or other ui pending signal.<br></div><div></div>Her a walk around using a timer :<br><br>Button {<br> x: Theme.horizontalPageMargin<br> text: qsTr("Hello Sailors")<br> onClicked: {<br> ta.text += "hello";<br> focus=false;<br><br> bp_d.start();<br> }<br><br> Timer {<br> id:bp_d<br> interval: 200<br> repeat: false<br> onTriggered: {<br> ta.forceActiveFocus();<br> }<br> }<br>}<br><br>TextField {<br> id: ta<br> width: parent.width<br> text: "test"<br> focus: true<br>}<br><div><div><br><br></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">2017-06-22 11:09 GMT+02:00 Michael Fuchs <span dir="ltr"><<a href="mailto:michfu@gmx.at" target="_blank">michfu@gmx.at</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Guys,<br>
<br>
I got a textinput (e.g. TextField) in which the text gets manipulated by pushing a button. After the manipulation the input should get back focus. I'm trying it like this:<br>
<br>
Button {<br>
x: Theme.horizontalPageMargin<br>
text: qsTr("Hello Sailors")<br>
onClicked: {<br>
ta.text += "hello"<br>
ta.forceActiveFocus()<br>
}<br>
}<br>
TextField {<br>
id: ta<br>
text: "test"<br>
focus: true<br>
}<br>
<br>
But it only works every second time. How could I workaround this?<br>
<br>
Thanks,<br>
Michael.<br>
______________________________<wbr>_________________<br>
SailfishOS.org Devel mailing list<br>
To unsubscribe, please send a mail to <a href="mailto:devel-unsubscribe@lists.sailfishos.org" target="_blank">devel-unsubscribe@lists.sailfi<wbr>shos.org</a></blockquote></div><br></div>