From 5c31a23d847b042f01d78a7f7ef92a0ea1b60573 Mon Sep 17 00:00:00 2001 From: William Moore Date: Tue, 31 Jan 2023 11:49:53 +0000 Subject: [PATCH] Disable default form submission handling --- idr_gallery/static/idr_gallery/omero_search_form.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/idr_gallery/static/idr_gallery/omero_search_form.js b/idr_gallery/static/idr_gallery/omero_search_form.js index cd212f14..0a4ed866 100644 --- a/idr_gallery/static/idr_gallery/omero_search_form.js +++ b/idr_gallery/static/idr_gallery/omero_search_form.js @@ -329,6 +329,12 @@ class OmeroSearchForm { this.$form.html(`
`); this.$form.append($(FORM_FOOTER_HTML)); + // disable default form submission behaviour + // NB: Only needed on Safari + this.$form.on("submit", (event) => { + event.preventDefault(); + }); + // If resultsId, create results element... if (resultsId) { this.$results = $(`#${resultsId}`);