Skip to content

Commit

Permalink
Fixed #494:Add descriptive placeholder text for Select dropdown
Browse files Browse the repository at this point in the history
  • Loading branch information
Mythili authored and sadanandpai committed Nov 12, 2024
1 parent f91ca31 commit 453b083
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions apps/host/src/components/common/multi-select/multi-select.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,14 @@ interface Props {
width?: string;
optionSelected: OptionType[] | null;
setOptionSelected: (selected: OptionType[]) => void;
selectPlaceholder?: string;
}
const CustomSelect: React.FC<Props> = ({
data,
width = '100%',
optionSelected,
setOptionSelected,
selectPlaceholder,
}) => {
const { theme } = useContext(ThemeContext);
const handleChange = (selected: OptionType[]) => {
Expand All @@ -55,6 +57,7 @@ const CustomSelect: React.FC<Props> = ({
}}
onChange={(newValue: unknown) => handleChange(newValue as OptionType[])}
value={optionSelected}
placeholder={selectPlaceholder}
styles={{
control: (base) => ({
...base,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,14 @@ const ChallengeFilters = ({
data={DeveloperList}
optionSelected={optionSelected}
setOptionSelected={(val: OptionType[]) => setOptionSelected(val)}
selectPlaceholder="Select Developers"
/>

<CustomSelect
data={Difficulties}
optionSelected={selectedDifficulties}
setOptionSelected={(val: OptionType[]) => setSelectedDifficulties(val)}
selectPlaceholder="Select Difficulties"
/>
<CustomCheckbox
className={styles.checkbox}
Expand Down

0 comments on commit 453b083

Please sign in to comment.