762
Views
4
Comments
Solved
Input_SetFocus for Mobile App
Question

Mobile App: Can I get some guidance on how to set focus to designated input field on page load?

Am I missing something because I cannot add Rich Widget dependency to a Mobile App module as they are greyed out, which have the Input_SetFocus widget.




2016-11-20 11-27-52
João Neves
Solution

Hi Marcus,

Richwidgets is a web module, thus it can't be added to a mobile module.

Set the autofocus extended attribute on the input:


UserImage.jpg
Marcus Wong

Thanks for that, it solves my original problem. Now, I am thinking of applying that to another purpose like below but does not seemed to work (I am trying no focus on any inputs if condition is false). I understand that maybe autoFocus actually do not have true/false when used in CSS. Any suggestions?

2016-11-20 11-27-52
João Neves

Try with empty string ("") instead of false

2019-11-08 20-43-10
Alexander Bouma

I have been trying to implement this myself. The first part(without the condition) works. However it is giving issues when the input is part of one the Tabs (it keeps pulling the input to the front through the tabs themselves). If I add a condition however -like Marcus Wong in his last post- the whole autofocus stops working, even if I include the empty string.

I am very curious if someone has found another solution of doing this.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.