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 appears misaligned and cut off if scrolled to the right #43025

Closed
devuxer opened this issue Jun 15, 2023 · 9 comments · Fixed by #43403
Closed

Dropdown appears misaligned and cut off if scrolled to the right #43025

devuxer opened this issue Jun 15, 2023 · 9 comments · Fixed by #43403

Comments

@devuxer
Copy link

devuxer commented Jun 15, 2023

Reproduction link

https://stackblitz.com/edit/react-sk6ex7?file=demo.tsx

Steps to reproduce

Place Dropdown off screen to the right then scroll page to see it.

What is expected?

Menu renders correctly.

What is actually happening?

Menu is offset to the left and narrower than it should be, causing menu items to wrap.

Environment Info
antd 5.6.1
React 18.2.0
System Windows 10.0.19044 Build 19044
Browser Chrome 114.0.5735.110 (Official Build) (64-bit)

Possibly related: #29366

@zombieJ
Copy link
Member

zombieJ commented Jun 15, 2023

Could you provide a screenshot about this?

@devuxer
Copy link
Author

devuxer commented Jun 15, 2023

@zombieJ

image

@afc163
Copy link
Member

afc163 commented Jun 15, 2023

文本在视距外的排版异常,确实是个老问题了。

@devuxer
Copy link
Author

devuxer commented Jun 15, 2023

@afc163, Can this be fixed? Is there a workaround?

@afc163
Copy link
Member

afc163 commented Jun 16, 2023

It could be fixed, we are looking for solutions.

@zombieJ
Copy link
Member

zombieJ commented Jun 16, 2023

Is max-content style help?

https://stackblitz.com/edit/react-sk6ex7-jjj5nw?file=demo.tsx

@devuxer
Copy link
Author

devuxer commented Jun 17, 2023

@zombieJ , YESSS! That fixes it. Thank you!

Maybe you could make that the default?

@zombieJ
Copy link
Member

zombieJ commented Jun 21, 2023

@zombieJ , YESSS! That fixes it. Thank you!

Maybe you could make that the default?

max-content maybe not the best way by default. Since if content use flex layout of auto wrap. It will count wrong width. But in most case, its safe.

@edisonLzy
Copy link

文本在视距外的排版异常,确实是个老问题了。

为什么会在视距外 会存在这个问题呢 ?

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

Successfully merging a pull request may close this issue.

4 participants