Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

React JS : React Select Dropdown position to top if there is no space below

I am using React Select

I want its Dropdown position to be dynamic. let's say if there is no space below it, then the dropdown should be opened to above select box.

<Select
  value={selectedOption}
  onChange={this.handleChange}
  options={options}
/>

Is there any option to make dropdown position dynamic?

Any help would be great.

Thank You.

like image 605
Xperia Reno Avatar asked May 25 '20 06:05

Xperia Reno


Video Answer


1 Answers

You can use menuPlacement option on your Select component with "bottom" (default), "top" or "auto".

You can see other props here ;)

like image 93
EVDW Avatar answered Sep 21 '22 03:09

EVDW