Hello everyone,

I want to set focus within the elements of a modal when I open it.

Currently, when I start modal, the focus starts on browser items, and right after clicking the TAB a few times, I can go to the buttons within the modal.

I am using OS 11 for web, my example link is this: https://nunoricardorodrigues.outsystemscloud.com/myApp/Homepage.aspx

Thanks in advance.

Best regards,

Nuno Rodrigues

Hi Nuno,

Can you try using the extended properties for the specific button:

Just add : autofocus="autofocus"


even as per your example it will work with InputBox

assif_tiger wrote:

Hi Nuno,

Can you try using the extended properties for the specific button:

Just add : autofocus="autofocus"


even as per your example it will work with InputBox

Hi assif_tiger,

I have try your suggest and don´t work. You can check in my development link.

I have done some research and the right way is just to add autofocus, but still don´t work.

Best Regards,

Nuno R


Nuno Rodrigues wrote:

assif_tiger wrote:

Hi Nuno,

Can you try using the extended properties for the specific button:

Just add : autofocus="autofocus"


even as per your example it will work with InputBox

Hi assif_tiger,

I have try your suggest and don´t work. You can check in my development link.

I have done some research and the right way is just to add autofocus, but still don´t work.

Best Regards,

Nuno R


Hi Nuno,


Have you tried using autofocus property in input instead of the button?



That worked for me.

working link

https://pankajpant824.outsystemscloud.com/OSMDb/WebScreen1.aspx



Regards,

Pankaj




Hi Pankaj,

Don´t work for me :). Maybe browser issue? I´m using Chrome Version 76.0.3809.132.

I have read some articles and the issue maybe is related with the fact that we put autofocus and still the modal is not open yet.

I will continue to try.

Best Regards,

Nuno R



Hi Nuno R,

If autofocus property is not working you can simply use js code on model up.

like

SyntaxEditor Code Snippet

$(document).ready(function(){
    
       $('.inputName').focus();
    
});


Hope this will help you.


Kind Regards

Rahul Sahu

Hi all,

I just add a GIF that I have record from the browser behavior hope that helps understand my issue.

I also try to put the JS code and don´t work. I add a console.log that I can see the JS code.

Link: https://nunoricardorodrigues.outsystemscloud.com/myApp/Entry1.aspx

Best Regards,

Nuno R