ant-design "placement" not working

c3frrgcw  于 2023-02-04  发布在  其他
关注(0)|答案(7)|浏览(361)

https://prnt.sc/iIcASsCX2Fdv

Steps to reproduce

Put placement="bottomLeft"

What is expected?

It is expected for dropdown to be at the bottom left

What is actually happening?

The fropdown is on top, not bottom

EnvironmentInfo
antd5.1.6
React18.2.0
SystemAll
BrowserChrom

It is not like docs say "The position where the selection box pops up" but more like "The desired position where..." so the dropdown will not care about this prop and if there is more free space above the input, the dropdown will be at the top and ignore the prop placement="bottomLeft"

xxls0lw8

xxls0lw82#

Hello @goran-dev. Please provide a online reproduction by forking codesandbox of antd@5.x or antd@4.x , or provide a minimal GitHub repository. Issues labeled by Need Reproduce will be closed if no activities in 3 days.

你好 @goran-dev, 我们需要你提供一个在线的重现实例以便于我们帮你排查问题。你可以通过点击这里创建一个 antd@5.xantd@4.x 的 codesandbox,或者提供一个最小化的 GitHub 仓库。3 天内未跟进此 issue 将会被自动关闭。

zqry0prt

zqry0prt3#

I provided screenshot already, "online reproduction by forking code..." too much, faster to switch from ant-design to different LIbrary.

mrzz3bfm

mrzz3bfm4#

Just fork our CodeSandbox example and provide minimized reproduction. It would help a lot if there's problem with components of antd.

jjjwad0x

jjjwad0x5#

Ok.
https://codesandbox.io/s/antd-reproduction-template-forked-f7zc8n?file=/index.js
So if you open select in example, it will ignore placement="bottomLeft" , because I guess there is more space at the top
If you scroll a bit down, to make space at the bottom, then it will open at the bottom.

I am expecting, if placement="bottomLeft" is set, the it will always be like that.

Thanks!

vmdwslir

vmdwslir6#

Since dropdown will be adjust automatically, placement will be changed due to the position of target element.

vohkndzv

vohkndzv7#

Yeah I know and told you already. So placement="bottomLeft" doesn't work. "placement" is then automatic. If this will not be fixed, update API documentation accordingly

相关问题