Calling `preventDefault` on `keypress` events suppresses browser clipboard events
mvlabat opened this issue · comments
winit/src/platform_impl/web/web_sys/canvas.rs
Line 193 in 33fb62b
This particular line of code prevents browsers to send clipboard events if winit's canvas is focused.
That makes it troublesome to add copy/cut/paste events support to UI frameworks.
I believe this problem has already been brought up in #1768, but copy/cut/paste wasn't explicitly called out there.
You can now use WindowBuilder::with_prevent_default(false)
.
Though ultimately this should also be solved by #2156 or #2831.
I researched this briefly, as far as I can tell you can change clipboard keybinds, so we could also expose an option to not use preventDefault()
when we detect the clipboard keybinds.