From 80b0919584affa13f1c6018cb542943e498f18e9 Mon Sep 17 00:00:00 2001 From: Per Bothner Date: Sun, 22 Aug 2021 00:23:02 -0700 Subject: [PATCH] In custom_titlebar example handle touchstart event to drag titlebar (#392) --- examples/custom_titlebar.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/examples/custom_titlebar.rs b/examples/custom_titlebar.rs index f4dec7fad..1df596e20 100644 --- a/examples/custom_titlebar.rs +++ b/examples/custom_titlebar.rs @@ -56,6 +56,11 @@ fn main() -> wry::Result<()> { : window.rpc.notify('drag_window'); } }) + document.addEventListener('touchstart', (e) => { + if (e.target.classList.contains('drag-region')) { + window.rpc.notify('drag_window'); + } + }) const style = document.createElement('style'); style.textContent = `