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

Popover and Select #3438

Closed
plandem opened this issue Oct 14, 2016 · 9 comments
Closed

Popover and Select #3438

plandem opened this issue Oct 14, 2016 · 9 comments
Labels
❓FAQ issues would be discussed a lot

Comments

@plandem
Copy link
Contributor

plandem commented Oct 14, 2016

Is it possible to prevent the changing of visibility of popover after interaction with Select?

Here is demo:
http://codepen.io/anon/pen/XjBVbp?editors=0011

@afc163
Copy link
Member

afc163 commented Oct 14, 2016

getPopupContainer https://ant.design/components/select/#Select-props

https://codepen.io/anon/pen/NaMbVg?editors=0011

You can use getPopupContainer={triggerNode => triggerNode.parentNode} to make select dropdown menu rendering inside the Popover content.

https://github.com/ant-design/ant-design/wiki/FAQ#select-dropdown-datepicker-timepicker-popover-popconfirm-will-scroll-with-page

#3487

@plandem
Copy link
Contributor Author

plandem commented Oct 14, 2016

Works! i would add this to official examples. Thanks.

@plandem plandem closed this as completed Oct 14, 2016
@afc163 afc163 added the ❓FAQ issues would be discussed a lot label Oct 6, 2018
@guohuihuiguo
Copy link

guohuihuiguo commented Apr 30, 2019

hello
我试着用上面的方法 getPopupContainer={(triggerNode: any) => triggerNode.parentNode} 结果

1556620903631-image
遮盖了select<Select getPopupContainer={(triggerNode: any) => triggerNode.parentNode} mode="multiple" notFoundContent={selectLoading ? <Spin size="small" /> : ``} filterOption={false} onSearch={this.totalFocusHandler.bind(this, siteCode)} style={{ width: '100%' }} > {siteCodeList.map((item: any, index: any) => <Option key={${item.sitecode}${index}} value={item.sitecode} >{item.sitecode}</Option>)} </Select>

@mix0000
Copy link

mix0000 commented Oct 12, 2021

getPopupContainer https://ant.design/components/select/#Select-props

https://codepen.io/anon/pen/NaMbVg?editors=0011

You can use getPopupContainer={triggerNode => triggerNode.parentNode} to make select dropdown menu rendering inside the Popover content.

https://github.com/ant-design/ant-design/wiki/FAQ#select-dropdown-datepicker-timepicker-popover-popconfirm-will-scroll-with-page

#3487

Thats not work for Ant Date Pickers.

@krmao
Copy link

krmao commented Oct 20, 2021

try to set position: relative; to the <DatePicker.RangePicker /> parent <div /> @mix0000

@mix0000
Copy link

mix0000 commented Oct 20, 2021

try to set position: relative; to the <DatePicker.RangePicker /> parent

Okey I fix it!

Antd uses rc-picker which uses dom-align and they have options for positioning your element.

<DatePicker
  ....
  dropdownAlign={{
    points: ["tr", "br"]
  }}
  ....
/>

@lwh795
Copy link

lwh795 commented Jan 11, 2022

Use getpopupcontainer = {triggernode = > triggernode. Parentnode} in the select in the modal. When the focus is obtained in IE 11,the whole modal will flash.

@lwh795
Copy link

lwh795 commented Jan 11, 2022

使用 getpopupcontainer = {triggernode = > triggernode. Parentnode} 在模态中的选择中。在 IE 11 中获得焦点时,整个 modal 会闪烁。

For the same problem as this bug(#21039), I found a temporary solution from the comments

@chandpratik
Copy link

getPopupContainer https://ant.design/components/select/#Select-props
https://codepen.io/anon/pen/NaMbVg?editors=0011
You can use getPopupContainer={triggerNode => triggerNode.parentNode} to make select dropdown menu rendering inside the Popover content.
https://github.com/ant-design/ant-design/wiki/FAQ#select-dropdown-datepicker-timepicker-popover-popconfirm-will-scroll-with-page
#3487

Thats not work for Ant Date Pickers.

Try using getCalendarContainer={trigger => trigger.parentElement}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
❓FAQ issues would be discussed a lot
Projects
None yet
Development

No branches or pull requests

7 participants