diff --git a/static/js/receipt_upload.js b/static/js/receipt_upload.js index 04107ad..2ebdc11 100644 --- a/static/js/receipt_upload.js +++ b/static/js/receipt_upload.js @@ -91,11 +91,13 @@ if (!window.receiptUploaderInitialized) { } document.addEventListener("DOMContentLoaded", function () { - const isMobile = /Mobi|Android|iPhone|iPad/i.test(navigator.userAgent); const galleryBtn = document.getElementById("galleryBtn"); const galleryInput = document.getElementById("galleryInput"); - if (!isMobile && galleryBtn && galleryInput) { + const isProbablyMobile = + window.matchMedia("(pointer: coarse)").matches || /Mobi|Android|iPhone|iPad/i.test(navigator.userAgent); + + if (!isProbablyMobile && galleryBtn && galleryInput) { galleryBtn.style.display = "none"; galleryInput.disabled = true; }