HTML element focus not working within ChromiumWebBrowser #3541
Unanswered
HorvatJosip
asked this question in
Q&A
Replies: 1 comment 3 replies
-
Did you give the WinForms control focus? Rather than using WindowsFormsHost the https://www.nuget.org/packages/CefSharp.Wpf.HwndHost/ provides a HwndHost implementation. |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
I am using the
ChromiumWebBrowser
to display the login form for Identity Server within a WPF project and I can't get the username field to focus once the form loads.The NuGet installed within the project is
CefSharp.WinForms
version 88.2.90.0.(
IdentityModel.OidcClient
NuGet version is 3.0.0.0)The flow is set up as follows: create
OidcClientOptions
withBrowser
property set to instance of browser class that creates aChromiumWebBrowser
and places it inside aWindowsFormsHost
(Child
property set to instance ofChromiumWebBrowser
) on a new WPF window (Content
set to theWindowsFormsHost
mentioned before). Passing the options toOidcClient
and callingLoginAsync
fires up the browser.These are things I've tried:
autofocus
HTML attributeThis is really weird because the input is actually focused (according to
document.activeElement.name
), but it just doesn't register it unless I press the tab key.Beta Was this translation helpful? Give feedback.
All reactions