Welcome Guest Search | Active Topics | Sign In | Register

Focus issues WebView Options
BakkerElkhuizen Group BV
Posted: Wednesday, March 7, 2018 10:38:51 AM
Rank: Newbie
Groups: Member

Joined: 3/7/2018
Posts: 6
Hi,

We have an WPF application with a WPF WebControl on it and some buttons.

When we use Tab key to shift focus from a button to the WebView it looks like something gets the focus before the first control in the loaded page gets the focus.
If the first control in the loaded page is focused and we use Shift-Tab the focus shifts directly to the button.
Is it possible to get the focus on the first control in the loaded page?

We also have a problem if we switch to another application and back. If a control in the WebView was focused it loses focus.
Is it possible to restore the focus to get the same behavior as a default xaml control?

Thanks!
eo_support
Posted: Wednesday, March 7, 2018 3:33:41 PM
Rank: Administration
Groups: Administration

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

The "something" that receives the focus before the first control is the page itself. If you have control over the page, you can add the some JavaScript code to your page to automatically focus the first control (or any other control) when the page receives focus:

Code: JavaScript
window.onfocus = function()
{
    document.getElementById("control_you_wish_to_focus").focus();
}


We will also look into this and see if we can do this automatically on our end.

As to when switching application to another and back, that has to do with WPF focus management because it only manages the focus to the WebControl level without knowing anything inside the WebControl. We are not aware of any simple way to automatically restore focus in this case. We will look into this issue as well as we work on the above issue.

Thanks!



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.