Dropdown scroll within a popover closes popover
See original GitHub issue- I have searched the issues of this repository and believe that this is not a duplicate.
Reproduction link
Steps to reproduce
Scrolling dropdown with the scrollbar inside a popover closes the popover. Scrolling with a wheel/trackpad works.
const App = () => {
const [visible, setVisible] = useState(false);
const handleVisibleChange = (visible) => {
setVisible(visible);
};
return (
<Popover
content={
<div>
<Select style={{ width: 300 }}>
{new Array(30).fill({}).map((_, i) => (
<Select.Option key={i}>{i}</Select.Option>
))}
</Select>
</div>
}
title="Title"
trigger="click"
visible={visible}
onVisibleChange={handleVisibleChange}
>
<Button type="primary">Click me</Button>
</Popover>
);
};
https://user-images.githubusercontent.com/51488/114467391-b6444e80-9b9e-11eb-9014-0281e50cfc93.mp4
What is expected?
To have both popover and dropdown stay open.
What is actually happening?
Popoever closes and then the dropdown closes.
Environment | Info |
---|---|
antd | 4.15.1 |
React | 16.14.0 |
System | OS X |
Browser | Chrome 89 |
Issue Analytics
- State:
- Created 2 years ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
Bootstrap 4: Why popover inside scrollable dropdown doesn't ...
I need overflow:hidden; to make the dropdown scroll, but the popover is hidden too. I tried to use container:'body' but it didn't work....
Read more >Popover Usage - ServiceNow Developers
The popover maintains its position relative to the triggering element when the triggering element is scrolled out of view. When the content exceeds...
Read more >Popover - Carbon Design System
Scrolling is usually not needed when using a popover. If scrolling is needed, in a dropdown like situation for instance, then the body...
Read more >Popover issue in filemaker go - Claris Community
4) Click anywhere on the popover. The popover closes like if I had clicked outside it. If there's a button behind it, it...
Read more >How to prevent popup close on scroll in Kendo UI for jQuery
And press 'Edit this example'. In dojo You will see the 'bug'. If You choose library Q2 or Q2 SP1, You can't scroll...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@elado, Fixed. Pls check: https://codesandbox.io/s/controlling-the-close-of-the-dialog-antd4151-forked-vcoe4?file=/index.js
@afc163
Thanks. Looks like this bug still exists in
4.15.1
(see codesandbox link). ThegetPopupContainer
works though.