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

wrong position in tabs' dropdown menu #8067

Open
1 task done
hunshcn opened this issue Mar 13, 2025 · 1 comment
Open
1 task done

wrong position in tabs' dropdown menu #8067

hunshcn opened this issue Mar 13, 2025 · 1 comment

Comments

@hunshcn
Copy link

hunshcn commented Mar 13, 2025

  • I have searched the issues of this repository and believe that this is not a duplicate.

Version

4.2.6

Environment

Reproduction link

https://antdv.com/components/tabs-cn#components-tabs-demo-custom-add-trigger

Steps to reproduce

click "ADD" multiple times, hover to right dropdown button

What is expected?

same to https://ant.design/components/tabs#tabs-demo-custom-add-trigger
close buttons should be on the right

Image

What is actually happening?

close buttons close to the text

Image

css is right, but dom this fault

@hunshcn
Copy link
Author

hunshcn commented Mar 15, 2025

问题是由于 react 使用 rc-tabs,dom 为 rc-tabs 构造,vue 为自编写组件,复用 MenuItem。MenuItem 会为 children wrap 一个 span

const wrapNode = <span class={`${prefixCls.value}-title-content`}>{children}</span>;

多的一层 span 导致样式错乱
有三种修复途径

  1. 为 MenuItem 增加一个 prop 能够禁止 wrap span 的行为
  2. 修改 css 以适应 dom。
  3. 放弃此处对于 MenuItem 的复用,像 rc-tabs 一样重写。

@tangjinzhou 哪一个会更希望被得到实现

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

No branches or pull requests

1 participant