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

Tab component starts flickering if inside flex container #44668

Closed
Comum opened this issue Sep 6, 2023 · 10 comments
Closed

Tab component starts flickering if inside flex container #44668

Comum opened this issue Sep 6, 2023 · 10 comments
Labels
🐛 Bug Ant Design Team had proved that this is a bug.

Comments

@Comum
Copy link

Comum commented Sep 6, 2023

Reproduction link

Edit on CodeSandbox

Steps to reproduce

Nest Tabs component in a div that has dynamic width ( flex wrapper ) the tab items start flickering. Check the codesandbox example.

What is expected?

Wanted to vertically centre the Tabs component.

What is actually happening?

Tabs component is centered but there is a flick because of the .ant-tabs- nav-operations and the ellipsis button.

Environment Info
antd 5.8.5
React 18.2.0
System Mac OS Ventura 13.1
Browser Chrome for sure, potentially all
@zombieJ zombieJ added 🐛 Bug Ant Design Team had proved that this is a bug. and removed unconfirmed labels Sep 6, 2023
@xiaozisong
Copy link
Contributor

我来试试

@xiaozisong
Copy link
Contributor

因为当flex布局时,元素的offsetLeft+width大于容器宽度后,就会显示operationNode,但是,是实时计算的就会出现闪屏的现象,那怎么优化useVisibleRange方法呢??

@solitia7125
Copy link
Contributor

我提个PR看看

@Comum
Copy link
Author

Comum commented Sep 15, 2023

Any news on the progress of the PR?

@Grawl
Copy link

Grawl commented Sep 21, 2023

It's very annoying

@solitia7125
Copy link
Contributor

solitia7125 commented Sep 22, 2023

Any news on the progress of the PR?

Sorry. Probably be later because im busy with interviews.

@Comum
Copy link
Author

Comum commented Oct 3, 2023

Hey guys, applied this patch with patch-package and the issue still happens ( a lot less ).

NOTE: Actually the patch was not being correctly applied. After applying correctly, it worked 👍

@jiang-zhong-xi
Copy link

I have same issue

@Grawl
Copy link

Grawl commented Oct 11, 2023

@Comum can you show how exactly you applied a patch?

@Comum
Copy link
Author

Comum commented Oct 12, 2023

I used patch-package on my project.

  • changed the node modules manually
  • then ran npx patrch-package rc-tabs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 Bug Ant Design Team had proved that this is a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants