Welcome Guest Search | Active Topics | Sign In | Register

EO.WebBrowser - autofocus attribute ignored Options
Fabien
Posted: Monday, July 21, 2014 12:39:10 PM
Rank: Advanced Member
Groups: Member

Joined: 7/21/2014
Posts: 129
Hi,

When you navigate on a page with an input with the autofocus attribute, the webbrowser don't set focus on this element. It seems the autofocus attribute on the html input is ignored.

Page sample : http://www.w3schools.com/tags/tryit.asp?filename=tryhtml5_input_autofocus

Is there something can I do for the EO.webbrowser and autofocus html attribute become friends? :)

Thanks
eo_support
Posted: Wednesday, July 23, 2014 2:42:32 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,080
Hi,

We tested this and it seems to be working fine. The autofocus only matters if the focus is inside the WebView. For example:

1. If the WebView is the only control inside a Form, then when the Form is displayed, the WebView will be automatically focused (since its the only child control). When the WebView is focused, it will set focus to the autofocus input element;
2. If the Form has a TextBox and a WebView with the TextBox being the first control, then when the Form is displayed, the TextBox will be focused. Nothing inside the WebView will be focused at this point since the WebView as a whole does not have focus. However if user tabs into the WebView from the TextBox, then the autofocus input element will be focused;

In a way, you can think autofocus as a shortcut to change an input element's tab order to be before all other input elements in the page. It does not automatically grab focus, instead it only affects the tab order when the focus is given to the WebView.

Hope this helps. Please feel free to let us know if you have any more questions.

Thanks!
Fabien
Posted: Thursday, July 24, 2014 2:52:49 AM
Rank: Advanced Member
Groups: Member

Joined: 7/21/2014
Posts: 129
Hi,

Thanks for your advice., I've resolved the "problem" by using the ActiveControl property and the .Focus() method.
eo_support
Posted: Thursday, July 24, 2014 9:13:36 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,080
Yes. That will work. Thanks for the update!


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.