-
Notifications
You must be signed in to change notification settings - Fork 840
fix: Allow Backspace and Delete keys in WASM Skia TextBox/PasswordBox #22277
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Co-authored-by: Jen-Uno <[email protected]>
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR fixes a critical bug where the Backspace key was not functioning correctly in TextBox and PasswordBox controls on WASM Skia, particularly affecting mobile soft keyboards on Android. The fix modifies the TypeScript keyboard event handler to allow Backspace and Delete keys to use the browser's default behavior rather than preventing it, ensuring that text deletion operations trigger properly through the oninput event.
Key Changes
- Modified the
onkeydownhandler inBrowserInvisibleTextBoxViewExtension.tsto allow Backspace and Delete keys to pass through - Added early return logic before
preventDefault()call for these specific keys - The browser's default behavior will now handle text deletion and propagate changes via the
oninputevent to managed code
src/Uno.UI.Runtime.Skia.WebAssembly.Browser/ts/Runtime/BrowserInvisibleTextBoxViewExtension.ts
Outdated
Show resolved
Hide resolved
src/Uno.UI.Runtime.Skia.WebAssembly.Browser/ts/Runtime/BrowserInvisibleTextBoxViewExtension.ts
Outdated
Show resolved
Hide resolved
|
@copilot issue is solely with Android. |
|
🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-22277/wasm-skia-net9/index.html |
|
🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-22277/docs/index.html |
Co-authored-by: Jen-Uno <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.
Co-authored-by: Jen-Uno <[email protected]>
|
🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-22277/wasm-skia-net9/index.html |
|
🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-22277/docs/index.html |
| if ((ev.key === "Backspace" || ev.key === "Delete") && !ev.ctrlKey && !ev.metaKey && !ev.altKey) { | ||
| return; | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This issue needs to be tested manually before being merged.
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.