Fix reset.
This commit is contained in:
parent
63b5d785b7
commit
d06a266903
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@tp/tp-dropdown",
|
"name": "@tp/tp-dropdown",
|
||||||
"version": "1.0.1",
|
"version": "1.0.2",
|
||||||
"description": "",
|
"description": "",
|
||||||
"main": "tp-dropdown.js",
|
"main": "tp-dropdown.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
@ -413,6 +413,8 @@ class TpDropdown extends BaseElement {
|
|||||||
const idx = this.items.findIndex(item => item.value === this.value);
|
const idx = this.items.findIndex(item => item.value === this.value);
|
||||||
if (idx > -1) {
|
if (idx > -1) {
|
||||||
this.label = this.items[idx].label;
|
this.label = this.items[idx].label;
|
||||||
|
} else {
|
||||||
|
this.label = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.invalid = false;
|
this.invalid = false;
|
||||||
@ -575,11 +577,7 @@ class TpDropdown extends BaseElement {
|
|||||||
this.invalid = false;
|
this.invalid = false;
|
||||||
this._memorizedValue = undefined;
|
this._memorizedValue = undefined;
|
||||||
this._filterTerm = '';
|
this._filterTerm = '';
|
||||||
if (this.default !== undefined) {
|
this.value = undefined;
|
||||||
this.value = this.default;
|
|
||||||
} else {
|
|
||||||
this.value = undefined;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
_itemsChanged() {
|
_itemsChanged() {
|
||||||
|
Loading…
Reference in New Issue
Block a user