Merge pull request #1792 from umap-project/fix-title-html

fix: do not add title to button if content is a DOM node
This commit is contained in:
David Larlet 2024-05-02 11:34:46 -04:00 committed by GitHub
commit 8679c0ded8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

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)
}