Skip to content
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

WasmEnableThreads and TextBox (WASM) #18213

Open
flucas1 opened this issue Feb 16, 2025 · 3 comments
Open

WasmEnableThreads and TextBox (WASM) #18213

flucas1 opened this issue Feb 16, 2025 · 3 comments

Comments

@flucas1
Copy link

flucas1 commented Feb 16, 2025

Describe the bug

When using WasmEnableThreads and using clipboard keyboard shortcuts, a letter is inserted in the TextBox.
If pressing CTRL+C, a c is inserted, and the text is copied to the clipboard,
If pressing CTRL+V a v is inserted in the textbox, in addition to the clipboard text.
Without WasmEnableThreads the behavior is as expected

To Reproduce

Net 9.0.2 and avalonia 11.2.3, 11.2.4 (not tested with older versions)

Expected behavior

No response

Avalonia version

11.2.4

OS

WebAssembly

Additional context

No response

@kekekeks
Copy link
Member

Is that with Firefox? This hack doesn't work in MT mode since input events are forcefully sent to a background thread by the runtime.

@flucas1
Copy link
Author

flucas1 commented Feb 17, 2025

I have tried on Windows, with LibreWolf, Chrome and Edge.
The behaviour is like described, CTRL+x / CTRL+v does the action and inserts extra key

And on Linux with Firefox, is the same as in windows

Linux and Chromium, CTRL+v, inserts the V, but does not paste any text, (and CTRL+c cuts the text instead of copy)

I can provide public access to the website, but it will take a few weeks, until it is ready for this.

@maxkatz6
Copy link
Member

I am almost certain it's caused by keydown events not being handled by MT backend, since JS handlers are sync, and MT code requires C# handlers to be async.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants