Fix multiline pasting in egui_web
Closes https://github.com/emilk/egui/issues/738
This commit is contained in:
parent
e2fa13ed2a
commit
c8bb4cf6e5
2 changed files with 8 additions and 4 deletions
|
@ -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
|
||||
|
|
|
@ -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(_)>);
|
||||
|
|
Loading…
Reference in a new issue