From d06a2669033965521cfa312e203319ae6491dfd7 Mon Sep 17 00:00:00 2001 From: trading_peter Date: Sun, 20 Mar 2022 21:48:41 +0100 Subject: [PATCH] Fix reset. --- package.json | 2 +- tp-dropdown.js | 8 +++----- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index bf98485..a15549a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@tp/tp-dropdown", - "version": "1.0.1", + "version": "1.0.2", "description": "", "main": "tp-dropdown.js", "scripts": { diff --git a/tp-dropdown.js b/tp-dropdown.js index 8f23d7d..ce525bc 100644 --- a/tp-dropdown.js +++ b/tp-dropdown.js @@ -413,6 +413,8 @@ class TpDropdown extends BaseElement { const idx = this.items.findIndex(item => item.value === this.value); if (idx > -1) { this.label = this.items[idx].label; + } else { + this.label = null; } this.invalid = false; @@ -575,11 +577,7 @@ class TpDropdown extends BaseElement { this.invalid = false; this._memorizedValue = undefined; this._filterTerm = ''; - if (this.default !== undefined) { - this.value = this.default; - } else { - this.value = undefined; - } + this.value = undefined; } _itemsChanged() {