Avoid keeping text after selecting item

This commit is contained in:
Antoine Bartuccio 2024-10-17 18:21:51 +02:00
parent 66dceefcf0
commit cac185634d

View File

@ -80,9 +80,14 @@ export class AjaxSelect extends InheritedComponent<"select"> {
},
});
// Allow removing selected items by clicking on them
this.widget.on("item_select", (item: TomItem) => {
this.widget.removeItem(item);
});
// Remove typed text once an item has been selected
this.widget.on("item_add", () => {
this.widget.setTextboxValue("");
});
}
}