0

I have a dropdown of 3 items and if I select one of the items, the dropdown displays remaining 2 items, so I wanted it to display all 3 despite of the selected values.

reference dropdown As per the reference image, polo shirt is selected so I want it to still appear as option in the dropdown, with some background so it appears selected.

1 Answers1

0

You can set the hideSelectedOptions={false} prop on your selector. That will keep selected items in your dropdown.

Here's a short sample doing just that

const options = [
  { value: "polo", label: "Polo shirt" },
  { value: "jeans", label: "Jeans" },
  { value: "top", label: "Top" },
];

export const Selector = () => {
  return <Select options={options} isMulti hideSelectedOptions={false}  />;
};
dybzon
  • 1,236
  • 2
  • 15
  • 21
  • Can you help with responsive of the same dropdown, I'm unable to select the options but I can see css changing on hover but it won't select . Reference- https://stackoverflow.com/questions/74253343/unable-to-click-choose-dropdown-options-in-mobile-screen-using-react-select-dro – NIKITA PANT Oct 30 '22 at 15:05