Project: titanium
Issue TIMOB-19639: Android: TextField setSelection(0,end) has to be called twice to select text
When trying to select the whole text in a TextField I use the setSelection function: {code:java} function selectText(e){ $.tf_1.setSelection(0,$.tf_1.value.length) } $.btn.addEventListener("click",selectText) $.index.open(); {code} {code:java}	Select text	{code} {noformat} "TextField": { right:50, left:50, color:"black" } ".container": { layout:"vertical", backgroundColor:"white" } {noformat} It's only working when the cursor is at the beginning. When it's in the middle or end it will just move the cursor to front and I have to click the button again to select the text. From the function call (0, length) I expect to start from 0 and select the whole text in one go Android 5 (Nexus 4) SDK 5.0.0.GA _Workaround:_ use {code:java} function selectText(e){ $.tf_1.setSelection(0,$.tf_1.value.length) _.delay(function(){ $.tf_1.setSelection(0,$.tf_1.value.length) },200); } {code}
Story points: 5