Fix multiline pasting in egui_web

Closes https://github.com/emilk/egui/issues/738
This commit is contained in:
Emil Ernerfeldt 2021-09-28 20:47:02 +02:00
parent e2fa13ed2a
commit c8bb4cf6e5
2 changed files with 8 additions and 4 deletions

View file

@ -6,8 +6,11 @@ All notable changes to the `egui_web` integration will be noted in this file.
## Unreleased
### Added
* Remove "http" feature (use https://github.com/emilk/ehttp instead!).
* `epi::NativeTexture` trait for webgl1 webgl2 painter
* Deprecate `Painter::register_webgl_texture`
* `epi::NativeTexture` trait for webgl1 webgl2 painter.
* Deprecate `Painter::register_webgl_texture.
### Fixed 🐛
* Fix multiline paste.
## 0.14.1 - 2021-08-28

View file

@ -641,8 +641,7 @@ fn install_document_events(runner_ref: &AppRunnerRef) -> Result<(), JsValue> {
}
#[cfg(web_sys_unstable_apis)]
// paste is handled by IME text agent!
if false {
{
// paste
let runner_ref = runner_ref.clone();
let closure = Closure::wrap(Box::new(move |event: web_sys::ClipboardEvent| {
@ -651,6 +650,8 @@ fn install_document_events(runner_ref: &AppRunnerRef) -> Result<(), JsValue> {
let mut runner_lock = runner_ref.0.lock();
runner_lock.input.raw.events.push(egui::Event::Text(text));
runner_lock.needs_repaint.set_true();
event.stop_propagation();
event.prevent_default();
}
}
}) as Box<dyn FnMut(_)>);