Repository navigation
fix: Allow Enter key propagation in WASM Skia TextBox for focus navigation on Android - #22299
Conversation
|
|
|
🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-22299/wasm-skia-net9/index.html |
|
🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-22299/docs/index.html |
There was a problem hiding this comment.
Pull request overview
This PR addresses a focus navigation issue on Android for WASM Skia applications where Enter key events were being prevented from propagating, blocking features like InputExtensions.AutoFocusNext from working. The fix modifies the keyboard event handler in BrowserInvisibleTextBoxViewExtension.ts to allow Enter key events to propagate when the TextBox doesn't accept return characters.
Key Changes
- Added a static
acceptsReturnfield to track whether the current TextBox accepts return characters - Modified
onkeydownhandler to skippreventDefault()for Enter key whenacceptsReturnis false, allowing the event to propagate to document-level listeners
|
|
|
🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-22299/docs/index.html |
|
|
|
🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-22299/wasm-skia-net9/index.html |
|
🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-22299/docs/index.html |
|
|
1 similar comment
|
|
|
🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-22299/wasm-skia-net9/index.html |
|
🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-22299/docs/index.html |
|
The |
|
|
a99a41f to
2ca9a34
Compare
|
🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-22299/wasm-skia-net9/index.html |
|
🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-22299/docs/index.html |
|
|
|
🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-22299/wasm-skia-net9/index.html |
|
🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-22299/docs/index.html |
|
|
GitHub Issue:
PR Type:
What is the current behavior? 🤔
Focus navigation via Enter key (e.g.,
InputExtensions.AutoFocusNextfrom Uno.Toolkit) fails on Android browsers in WASM Skia applications. The invisible HTML input element used for keyboard capture callspreventDefault()on all keydown events except clipboard operations, preventing Enter key events from reaching the document-level keyboard listener. This blocks KeyDown routed events from being raised on the TextBox.What is the new behavior? 🚀
Enter key events now propagate correctly when
TextBox.AcceptsReturn="False", allowing focus navigation to work on Android browsers.Implementation:
BrowserInvisibleTextBoxViewExtension.tsto trackacceptsReturnstatepreventDefault()for Enter key when TextBox doesn't accept returnsBrowserKeyboardInputSource, triggering KeyDown routed eventsExample usage:
Pressing Enter now correctly moves focus to the next field on Android browsers.
PR Checklist ✅
Other information ℹ️
The fix follows the same event propagation pattern already used for clipboard operations (Ctrl+C/V/X). Only affects Enter key behavior when
AcceptsReturnis false - multiline TextBox behavior unchanged.Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.