Hi!
Congrats for open sourcing this library!
I am migrating a Blazor Server application hosted in Electron to Avalonia, using NativeWebDialog as the main window wrapper. Everything loads correctly, but I am running into a strict focus issue.
When the dialog opens and the web page loads, the web view does not receive keyboard events (e.g., typing in a textbox or global key-down events). To get keyboard events to register, I have to physically click anywhere inside the loaded web page first. After that initial click, it works perfectly.
Is there a recommended way to programmatically hand over the OS-level keyboard focus to the embedded web view upon launch?
I attempted to workaround this by grabbing the native window handle to forcefully invoke SetFocus via user32.dll. However, calling TryGetPlatformHandle() on the dialog/window consistently returns null (tested on Windows), blocking this workaround.
A built-in, simple API (e.g., dialog.FocusWebView()) would be highly preferable to ensure a consistent cross-platform experience without forcing developers to drop into native interop for a standard UI requirement.
Thanks!
Hi!
Congrats for open sourcing this library!
I am migrating a Blazor Server application hosted in Electron to Avalonia, using NativeWebDialog as the main window wrapper. Everything loads correctly, but I am running into a strict focus issue.
When the dialog opens and the web page loads, the web view does not receive keyboard events (e.g., typing in a textbox or global key-down events). To get keyboard events to register, I have to physically click anywhere inside the loaded web page first. After that initial click, it works perfectly.
Is there a recommended way to programmatically hand over the OS-level keyboard focus to the embedded web view upon launch?
I attempted to workaround this by grabbing the native window handle to forcefully invoke SetFocus via user32.dll. However, calling TryGetPlatformHandle() on the dialog/window consistently returns null (tested on Windows), blocking this workaround.
A built-in, simple API (e.g., dialog.FocusWebView()) would be highly preferable to ensure a consistent cross-platform experience without forcing developers to drop into native interop for a standard UI requirement.
Thanks!