Make sure call on shouldUpdate works for mixins and use value instead of id.

This commit is contained in:
trading_peter 2024-08-16 14:04:30 +02:00
parent 33214cb38b
commit 6ab1920ce3
2 changed files with 3 additions and 3 deletions

View File

@ -1,6 +1,6 @@
{
"name": "@tp/tp-dropdown",
"version": "1.3.2",
"version": "1.3.4",
"description": "",
"main": "tp-dropdown.js",
"scripts": {

View File

@ -353,7 +353,7 @@ class TpDropdown extends BaseElement {
this.dispatchEvent(new CustomEvent('is-open-changed', { detail: this.isOpen, bubbles: true, composed: true }));
}
return true;
return super.shouldUpdate(changes);
}
updated(changes) {
@ -802,7 +802,7 @@ class TpDropdown extends BaseElement {
if (Array.isArray(this.items)) {
for (var i = 0, li = this.items.length; i < li; ++i) {
if (String(this.items[i].label).toLowerCase() === String(label)) {
this.value = this.items[i].id;
this.value = this.items[i].value;
return true;
}
}