fix: do not fail in autocomplete if on_unselect is undefined

This commit is contained in:
Yohan Boniface 2024-10-04 09:26:53 +02:00
parent ff5195a787
commit 13a7a2257d

View file

@ -313,7 +313,7 @@ export const SingleMixin = (Base) =>
DomEvent.on(close, 'click', () => {
this.selectedContainer.innerHTML = ''
this.input.style.display = 'block'
this.options.on_unselect(result)
this.options.on_unselect?.(result)
})
this.hide()
}
@ -342,7 +342,7 @@ export const MultipleMixin = (Base) =>
})
DomEvent.on(close, 'click', () => {
this.selectedContainer.removeChild(result_el)
this.options.on_unselect(result)
this.options.on_unselect?.(result)
})
this.hide()
}