Set a default type="button"
for JS buttons
> 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
This commit is contained in:
parent
688ef19c04
commit
a28d427ba1
1 changed files with 1 additions and 0 deletions
|
@ -318,6 +318,7 @@ L.DomUtil.createButton = (className, container, content, callback, context) => {
|
||||||
const el = L.DomUtil.add('a', className, container, content)
|
const el = L.DomUtil.add('a', className, container, content)
|
||||||
el.href = '#'
|
el.href = '#'
|
||||||
// const el = L.DomUtil.add('button', className, container, content)
|
// const el = L.DomUtil.add('button', className, container, content)
|
||||||
|
// el.type = 'button'
|
||||||
if (callback) {
|
if (callback) {
|
||||||
L.DomEvent.on(el, 'click', L.DomEvent.stop).on(el, 'click', callback, context)
|
L.DomEvent.on(el, 'click', L.DomEvent.stop).on(el, 'click', callback, context)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue