Saurabh Mishra
Saurabh Mishra

Reputation: 335

React select drop down is going below react table pagination

1[I tried to change the z-index of pagination to 0 it didnt't work]

Here is the link to my codesandbox: Please check the last select dropdown, it's going behind pagination.

https://codesandbox.io/s/jolly-chandrasekhar-uim6k

Upvotes: 3

Views: 3645

Answers (1)

logicallycorrect
logicallycorrect

Reputation: 106

React-select exposes a menuPortalTarget prop, that lets you portal the select menu to a dom node of your choosing.

To target body :

<ReactSelect
  options={[
    { value: "one", label: "One" },
    { value: "two", label: "Two" },
    { value: "three", label: "Three" }
  ]}
  menuPortalTarget={document.body}
/>

CodeSandbox Link : https://codesandbox.io/s/blissful-cerf-wqtto

Upvotes: 9

Related Questions