Describe the bug
Egui is registering a touchend event listener on the document and is calling preventdefault on the event. This prevents any touch interactions with dom elements shown on top of the canvas.
To Reproduce
Paste the following in the console on egui.rs (to create a simple html dialog):
let dialog = document.createElement("dialog");
let button = document.createElement("button");
button.innerHTML = "Hello";
dialog.appendChild(button);
button.onclick = () => alert("button click!!");
document.body.appendChild(dialog);
dialog.show()
Clicking the button now does nothing. (Make sure you enabled the device toolbar and set it to e.g. iPhone SE)
If we forcefully remove the egui touchend listener from document via
document.removeEventListener("touchend", getEventListeners(document).touchend[0].listener)
the button will become clickable.
Expected behavior
Egui shouldn't interfere with other dom elements. Maybe the touchend listener doesn't need preventDefault or it could be made configurable.
Additional context
The listener is added here:
|
install_touchend(runner_ref, &document)?; |
Describe the bug
Egui is registering a
touchendevent listener on the document and is calling preventdefault on the event. This prevents any touch interactions with dom elements shown on top of the canvas.To Reproduce
Paste the following in the console on egui.rs (to create a simple html dialog):
Clicking the button now does nothing. (Make sure you enabled the device toolbar and set it to e.g. iPhone SE)
If we forcefully remove the egui touchend listener from document via
the button will become clickable.
Expected behavior
Egui shouldn't interfere with other dom elements. Maybe the touchend listener doesn't need preventDefault or it could be made configurable.
Additional context
The listener is added here:
egui/crates/eframe/src/web/events.rs
Line 92 in af404fe