Skip to content
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

Dropdown should overlay the parent container #6750

Open
3 tasks done
YataoWang opened this issue Jan 5, 2024 · 1 comment
Open
3 tasks done

Dropdown should overlay the parent container #6750

YataoWang opened this issue Jan 5, 2024 · 1 comment
Labels

Comments

@YataoWang
Copy link

YataoWang commented Jan 5, 2024

Prerequisites

Describe the bug

I'm using react-bootstrap v2.9.2(Bootstrap 5). The dropdown is hidden if the parent has an overflow-y: auto style.

Expected behavior

In this case, the dropdown should overlay the parent container.

To Reproduce

import Dropdown from 'react-bootstrap/Dropdown';

function BasicExample() {
return (
<div style={{height: "100px", overflow: "auto"}}>

Testing Dropdown



<Dropdown.Toggle variant="success" id="dropdown-basic" drop="up">
Dropdown Button
</Dropdown.Toggle>
<Dropdown.Menu>
<Dropdown.Item href="#/action-1">Action</Dropdown.Item>
<Dropdown.Item href="#/action-2">Another action</Dropdown.Item>
<Dropdown.Item href="#/action-3">Something else</Dropdown.Item>
</Dropdown.Menu>


);
}

Reproducible Example

https://react-bootstrap.netlify.app/docs/components/dropdowns

Screenshots

image

What operating system(s) are you seeing the problem on?

Windows

What browser(s) are you seeing the problem on?

Chrome

What version of React-Bootstrap are you using?

v2.9.2

What version of Bootstrap are you using?

5.2.2

Additional context

No response

@YataoWang YataoWang added the bug label Jan 5, 2024
@Theycallmeholla
Copy link

I don't understand what you are trying to accomplish.

Why do you want to use the overflow-y? Is it supposed to be for a long list of options?

Are you expecting it to look like this:

Screenshot 2024-03-30 at 5 36 58 PM

if so, use this:

import Dropdown from 'react-bootstrap/Dropdown';

function BasicExample() {
  return (
    <Dropdown>
      <Dropdown.Toggle variant="success" id="dropdown-basic">
        Dropdown Button
      </Dropdown.Toggle>

      <Dropdown.Menu>
        <Dropdown.Item href="#/action-1">Action</Dropdown.Item>
        <Dropdown.Item href="#/action-2">Another action</Dropdown.Item>
        <Dropdown.Item href="#/action-3">Something else</Dropdown.Item>
      </Dropdown.Menu>
    </Dropdown>
  );
}

export default BasicExample;

If not could you be a little more clear on what you're trying to accomplish and maybe some context why?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants