Skip to content

Commit 1d1e691

Browse files
(Picklist): consider disabled
1 parent 906c378 commit 1d1e691

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/scripts/Picklist.tsx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,11 @@ function collectOptionValues(children: unknown): PicklistValue[] {
5050
return [];
5151
}
5252

53+
// Skip disabled items
54+
if ('disabled' in props && props.disabled === true) {
55+
return [];
56+
}
57+
5358
return [props.value];
5459
}).flat();
5560
}
@@ -86,6 +91,11 @@ function findSelectedItemLabel(
8691
return null;
8792
}
8893

94+
// Skip disabled items
95+
if ('disabled' in props && props.disabled === true) {
96+
return null;
97+
}
98+
8999
// Safely access label and children properties with proper type checking
90100
const label = 'label' in props ? props.label : undefined;
91101
const itemChildren = 'children' in props ? props.children : undefined;

0 commit comments

Comments
 (0)