Skip to content

Commit e6935a7

Browse files
committed
chore: check for null values and attributes
1 parent 65ebcb1 commit e6935a7

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

1st-gen/packages/picker/src/Picker.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -867,7 +867,8 @@ export class PickerBase extends SizedMixin(SpectrumElement, {
867867
// Only clear value when items exist with real values but none match.
868868
// Preserve value if items are pending (lazy loaded, async render, incomplete upgrade).
869869
const hasItemsWithValues = this.menuItems.some(
870-
(item) => item.value && item.value.trim() !== ''
870+
(item) =>
871+
item.value != null || item.getAttribute?.('value') != null
871872
);
872873
if (this.menuItems.length > 0 && hasItemsWithValues) {
873874
this.value = '';

0 commit comments

Comments
 (0)