@itenthusiasm/custom-elements 1.0.1 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Combobox/ComboboxOption.js +13 -5
- package/package.json +1 -1
|
@@ -132,11 +132,19 @@ class ComboboxOption extends HTMLElement {
|
|
|
132
132
|
if (!this.#combobox) return;
|
|
133
133
|
const combobox = this.#combobox;
|
|
134
134
|
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
if (combobox.
|
|
138
|
-
if (
|
|
139
|
-
|
|
135
|
+
// Selection
|
|
136
|
+
if (this.selected) {
|
|
137
|
+
if (combobox.value !== this.value) combobox.value = this.value;
|
|
138
|
+
else if (this.value === "" && combobox.text.data !== this.label) combobox.text.data = this.label;
|
|
139
|
+
}
|
|
140
|
+
// Deslection
|
|
141
|
+
else {
|
|
142
|
+
if (combobox.value !== this.value) return;
|
|
143
|
+
|
|
144
|
+
if (combobox.text.data && combobox.acceptsValue(combobox.text.data)) {
|
|
145
|
+
if (combobox.value !== combobox.text.data) combobox.value = combobox.text.data;
|
|
146
|
+
} else if (combobox.acceptsValue("")) combobox.forceEmptyValue();
|
|
147
|
+
else combobox.formResetCallback();
|
|
140
148
|
}
|
|
141
149
|
}
|
|
142
150
|
}
|
package/package.json
CHANGED