From 93dcae84d386e5f16659d1cd8fbba35582a3623f Mon Sep 17 00:00:00 2001 From: marwin Date: Thu, 19 Mar 2026 20:55:55 +0100 Subject: [PATCH] Prevent Firefox from opening dragged files outside drop zone Co-Authored-By: Claude Sonnet 4.6 --- static/js/app.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/static/js/app.js b/static/js/app.js index 522f763..e8f8d58 100644 --- a/static/js/app.js +++ b/static/js/app.js @@ -2199,6 +2199,13 @@ function bookFileSelected(input) { function initBookDropZone() { const zone = $('book-drop-zone'); + + // Prevent Firefox from opening dragged files when dropped outside the zone + document.addEventListener('dragover', e => e.preventDefault()); + document.addEventListener('drop', e => { + if (!zone || !zone.contains(e.target)) e.preventDefault(); + }); + if (!zone) return; zone.addEventListener('dragover', e => {