Ant-design: Select dropdown moves when scrolling

Created on 21 Nov 2017  ·  12Comments  ·  Source: ant-design/ant-design

Version

2.13.10

Environment

browser version

Reproduction link

https://codepen.io/anon/pen/XzEdgJ

Steps to reproduce

Open the modal by clicking on show button, open the drop down and resize the display view till you can scroll on the view with the menu open, then scroll down or up.

What is expected?

The drop down options should stay at the bottom of the menu when scrolling

What is actually happening?

The drop down options are staying in a fixed position of the screen when scrolling up or down

Usage

Most helpful comment

add this Select Props getPopupContainer={trigger => trigger.parentNode}

All 12 comments

You can use getPopupContainer to change the parent node which the selector should be rendered to. demo

Hello @Sokal21, we use GitHub issues to trace bugs or discuss plans of Ant Design. So, please don't ask usage questions here. You can try to ask questions on Stack Overflow or Segment Fault, then apply tag antd and react to your question.

Hi,
This is Ashok.
I am new for ant design.when i am designing the template i got some designing issues. ie i am designing select box dropdown options will be in fixed position.please check the below screen. i hope you understand my problem.
s 1
Thanks
Ashok

is this already fix?

Is this issue fixed ?

add this Select Props getPopupContainer={trigger => trigger.parentNode}

fwiw -- make sure your parent is set (as Driggs calls out) and its position=relative.

That solves the problem but causes rendering problem on internet explorer 11. Is there any one who has a solution ? Maybe you can say that it is because of console.log usage in app that causes this kind of problems but I used polyfill for console.log no effect.

For not making the menu fixed while scrolling
Use Dropdown Props
getPopupContainer={() => document.getElementById('id_of_dropdown_container') || document.body}
and in css file place
#id_of_dropdown_container .ant-dropdown-placement-topCenter {
position: fixed;
}