fix: do not add title to button if content is a DOM node

This commit is contained in:
Yohan Boniface 2024-05-02 17:11:52 +02:00
parent bb47299cfa
commit 916da8be94

View file

@ -98,7 +98,9 @@ L.DomUtil.createFieldset = (container, legend, options) => {
L.DomUtil.createButton = (className, container, content, callback, context) => {
const el = L.DomUtil.add('button', className, container, content)
el.type = 'button'
el.title = content
if (!content.nodeType) {
el.title = content
}
if (callback) {
L.DomEvent.on(el, 'click', L.DomEvent.stop).on(el, 'click', callback, context)
}