@itenthusiasm/custom-elements 1.0.0 → 1.0.1
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.
|
@@ -1185,9 +1185,11 @@ class ComboboxField extends HTMLElement {
|
|
|
1185
1185
|
const mutation = mutations[i];
|
|
1186
1186
|
|
|
1187
1187
|
// Handle added nodes first. This keeps us from running redundant Deselect Logic if a newly-added node is `selected`.
|
|
1188
|
-
mutation.addedNodes.forEach((
|
|
1189
|
-
if (!(
|
|
1188
|
+
mutation.addedNodes.forEach((n, j) => {
|
|
1189
|
+
if (!(n instanceof ComboboxOption) && n instanceof Element) return n.parentNode?.removeChild(n);
|
|
1190
1190
|
|
|
1191
|
+
// TODO: TypeScript fails to derive the correct type from the above check. Open a GitHub Issue.
|
|
1192
|
+
const node = /** @type {ComboboxOption} */ (n);
|
|
1191
1193
|
if (node.defaultSelected) this.value = node.value;
|
|
1192
1194
|
else if (nullable && this.#value === null && j === 0) {
|
|
1193
1195
|
if (this.valueIs !== "clearable") this.value = node.value;
|
package/package.json
CHANGED