Prevent Firefox from opening dragged files outside drop zone
All checks were successful
Build and push Docker image / build (push) Successful in 12s
Test / test (push) Successful in 16s

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
marwin 2026-03-19 20:55:55 +01:00
parent d5db882e30
commit 93dcae84d3

View file

@ -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 => {