Skip to content

Commit

Permalink
Merge pull request #266 from reaviz/bug/select-disabled-option
Browse files Browse the repository at this point in the history
fix disable select option and add story
  • Loading branch information
amcdnl authored Nov 1, 2024
2 parents 54b551b + 4d82809 commit 8f42cc9
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/form/Select/SelectMenu/SelectMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ export const SelectMenu: FC<SelectMenuProps> = ({
event.stopPropagation();
onSelectedChange(o);
}}
disabled={o.disabled}
>
{o.menuLabel ? (
o.menuLabel
Expand Down
15 changes: 15 additions & 0 deletions src/form/Select/SingleSelect.story.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -622,6 +622,21 @@ export const Disabled = () => (
</div>
);

export const DisabledOption = () => {
const [value, setValue] = useState<string | null>(null);
return (
<div style={{ width: 300 }}>
<Select value={value} onChange={v => setValue(v)} placeholder="Select...">
<SelectOption value="facebook">facebook</SelectOption>
<SelectOption value="twitter" disabled>
twitter
</SelectOption>
<SelectOption value="twitch">twitch</SelectOption>
</Select>
</div>
);
};

export const Unfilterable = () => {
const [value, setValue] = useState<string | null>('facebook');
return (
Expand Down

0 comments on commit 8f42cc9

Please sign in to comment.