From 6ab1920ce3573c3deead9729047ef495ad95bccc Mon Sep 17 00:00:00 2001 From: pk Date: Fri, 16 Aug 2024 14:04:30 +0200 Subject: [PATCH] Make sure call on shouldUpdate works for mixins and use value instead of id. --- package.json | 2 +- tp-dropdown.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index eb6d253..dfad173 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@tp/tp-dropdown", - "version": "1.3.2", + "version": "1.3.4", "description": "", "main": "tp-dropdown.js", "scripts": { diff --git a/tp-dropdown.js b/tp-dropdown.js index c06452e..28b0653 100644 --- a/tp-dropdown.js +++ b/tp-dropdown.js @@ -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; } }