Skip to content

Dropdown Hiding inside the table #4880

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Fir-3 opened this issue Oct 27, 2021 · 4 comments
Closed

Dropdown Hiding inside the table #4880

Fir-3 opened this issue Oct 27, 2021 · 4 comments
Labels
issue/bug-unconfirmed Issues that describe a bug that hasn't been confirmed by a maintainer yet

Comments

@Fir-3
Copy link

Fir-3 commented Oct 27, 2021

I have a react-select component in my table it works fine when there are lots of data but when I search for a row/value inside the table or If I have 2 or 3 rows in my table, my dropdown hides inside the table attaching the screenshot below
so can you help me with this, please?

Untitled

code sandbox --> https://codesandbox.io/s/tender-sound-95sgv?file=/src/App.js

  • react: ^16.14.0
  • react-data-table-component: ^7.0.0-rc6
  • react-select: ^4.3.1
@Fir-3 Fir-3 added the issue/bug-unconfirmed Issues that describe a bug that hasn't been confirmed by a maintainer yet label Oct 27, 2021
@Rall3n
Copy link
Collaborator

Rall3n commented Oct 27, 2021

Hello @Fir-3,

this is not directly a problem with react-select but with react-data-table-component setting overflow: hidden on its outermost container.

You can easily resolve this issue using the menuPortalTarget prop to render the opened dropdown outside of the table component (but still correctly aligned).

<Select menuPortalTarget={document.body} />

Please respond if this has solved your problem.

@Rall3n Rall3n added the awaiting-author-response Issues or PRs waiting for more information from the author label Oct 27, 2021
@Fir-3
Copy link
Author

Fir-3 commented Oct 27, 2021

Hello @Fir-3,

this is not directly a problem with react-select but with react-data-table-component setting overflow: hidden on its outermost container.

You can easily resolve this issue using the menuPortalTarget prop to render the opened dropdown outside of the table component (but still correctly aligned).

<Select menuPortalTarget={document.body} />

Hi @Rall3n,

Thank you for the solution, it works well. I posted this in the react-data-table-component team as well.
It's really helpful and appreciate your quick response.

Please close the issue as well since it is now resolved

@Rall3n Rall3n closed this as completed Oct 27, 2021
@Rall3n Rall3n removed the awaiting-author-response Issues or PRs waiting for more information from the author label Oct 27, 2021
@robxbob
Copy link

robxbob commented Aug 2, 2024

```js
<Select menuPortalTarget={document.body} />

Is there a way to resolve this without affecting accessibility? (if it does affect it)

@Pragati-Kashyap
Copy link

I've been stuck on this problem for so long. Thanks, @Rall3n, it worked perfectly!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
issue/bug-unconfirmed Issues that describe a bug that hasn't been confirmed by a maintainer yet
Projects
None yet
Development

No branches or pull requests

4 participants