From e2510cb2fa2433414c7048b9bbe4f6b339913236 Mon Sep 17 00:00:00 2001 From: icxes Date: Sat, 23 May 2026 17:01:48 +0300 Subject: [PATCH] stop error when dragging outside window with dsel active fixes https://github.com/9001/copyparty/issues/1491 --- copyparty/web/browser.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/copyparty/web/browser.js b/copyparty/web/browser.js index fee471cd..0421af93 100644 --- a/copyparty/web/browser.js +++ b/copyparty/web/browser.js @@ -10077,7 +10077,9 @@ function reload_browser() { return; } if (!dragging && dist > mvthresh && !window.getSelection().toString()) { - if (fwrap = e.target.closest('#wrap')) + if (e.target instanceof Element) + fwrap = e.target.closest('#wrap'); + if (fwrap) fwrap.style.userSelect = 'none'; else return; start_drag();