events: use delegated events as much as possible to avoid adding dom listeners when creating widgets

This commit is contained in:
jean-emmanuel 2022-01-28 16:06:26 +01:00
parent a7683787d2
commit 459a37960c
23 changed files with 172 additions and 113 deletions

View file

@ -156,7 +156,10 @@ class WidgetManager extends EventEmitter {
id = widget.getProp('id')
if (this.widgets[hash]) {
if (this.widgets[hash].onRemove) this.widgets[hash].onRemove()
if (this.widgets[hash].onRemove) {
this.widgets[hash].onRemove()
this.widgets[hash].off()
}
delete this.widgets[hash]