From a28d427ba1ddaeb5d534fe17fba848a31a201f2e Mon Sep 17 00:00:00 2001 From: David Larlet Date: Fri, 1 Sep 2023 14:35:38 -0400 Subject: [PATCH] Set a default `type="button"` for JS buttons MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit > The `button` [type] has no default behavior, and does nothing when pressed by default. It can have client-side scripts listen to the element's events, which are triggered when the events occur. — https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button --- umap/static/umap/js/umap.core.js | 1 + 1 file changed, 1 insertion(+) diff --git a/umap/static/umap/js/umap.core.js b/umap/static/umap/js/umap.core.js index 41bfd4bd..a5f79ec6 100644 --- a/umap/static/umap/js/umap.core.js +++ b/umap/static/umap/js/umap.core.js @@ -318,6 +318,7 @@ L.DomUtil.createButton = (className, container, content, callback, context) => { const el = L.DomUtil.add('a', className, container, content) el.href = '#' // const el = L.DomUtil.add('button', className, container, content) + // el.type = 'button' if (callback) { L.DomEvent.on(el, 'click', L.DomEvent.stop).on(el, 'click', callback, context) }