N.Marzio Posted September 13, 2023 Share Posted September 13, 2023 UniGui Mobile, how can I assign focus to a Tunimedit control? Why tunimedit.setfocus notWork on Mobile browser ? Tks Quote Link to comment Share on other sites More sharing options...
Sherzod Posted September 13, 2023 Share Posted September 13, 2023 Hello, Where are you using this code? Can you elaborate? Quote Link to comment Share on other sites More sharing options...
N.Marzio Posted September 13, 2023 Author Share Posted September 13, 2023 procedure TxFrmMage.cmdSelez(Sender: TObject; var Key: Word;Shift: TShiftState); var lVal : string; lMsg : string; lNum : integer; begin if (key = VK_F1) or (key = VK_F2) then begin cmdClose(nil); end; // if key <> VK_RETURN then exit; // // // I've tried every one of these possibilities // // // Not Working !! activeControl := edtEti;// <--- TUnimEdit // // Not Working !! UniSession.AddJS('setTimeout(function(){' + edtEti.JSName + '.focus()}, 100)'); // // Not Working !! edtEti.JSInterface.JSCall('focus', []) // // end; Quote Link to comment Share on other sites More sharing options...
Sherzod Posted September 14, 2023 Share Posted September 14, 2023 Which build are you using? Could you make a simple testcase to check? I couldn't reproduce... Quote Link to comment Share on other sites More sharing options...
N.Marzio Posted September 14, 2023 Author Share Posted September 14, 2023 Good morning, use version 1.90.0.1563 Tks. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted September 14, 2023 Share Posted September 14, 2023 13 minutes ago, N.Marzio said: use version 1.90.0.1563 Thanks. 3 hours ago, Sherzod said: Could you make a simple testcase to check? I couldn't reproduce... ? Quote Link to comment Share on other sites More sharing options...
N.Marzio Posted September 14, 2023 Author Share Posted September 14, 2023 Sorry but what do you mean by test? Looking at the example above, in none of the following cases // // Not Working !! activeControl := edtEti;// <--- TUnimEdit // // Not Working !! UniSession.AddJS('setTimeout(function(){' + edtEti.JSName + '.focus()}, 100)'); // // Not Working !! edtEti.JSInterface.JSCall('focus', []) The focus is returned to the requested field. The problem occurs on all browsers on mobile devices and also on desktop. What other case should I do? Thank you Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.