Skip to content

Commit 0c64a8a

Browse files
committed
Add disabled state for particular dropdown options
1 parent 47bc63a commit 0c64a8a

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

ui/components/app/snaps/snap-ui-renderer/components/dropdown.ts

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ export const dropdown: UIComponentFactory<DropdownElement> = ({
1212
const options = children.map((child) => ({
1313
value: child.props.value,
1414
name: child.props.children,
15+
disabled: child.props.disabled,
1516
}));
1617

1718
return {

ui/components/ui/dropdown/dropdown.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,11 @@ const Dropdown = ({
3535
>
3636
{options.map((option) => {
3737
return (
38-
<option key={option.value} value={option.value}>
38+
<option
39+
key={option.value}
40+
value={option.value}
41+
disabled={option.disabled}
42+
>
3943
{option.name || option.value}
4044
</option>
4145
);

0 commit comments

Comments
 (0)