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

fix(tabs): The tab was not fully displayed when scrollIntoView #2247

Merged

Conversation

l123wx
Copy link
Contributor

@l123wx l123wx commented May 20, 2024

English Template / 英文模板

  • 我已阅读并遵循了贡献文档中的PR指南.

PR类型 (请至少选择一个)

  • Bugfix
  • Feature
  • Code style update
  • Refactor
  • Test Case
  • TypeScript definition update
  • Document improve
  • CI/CD improve
  • Branch sync
  • Other, please describe:

PR 描述

原来按钮和 tab 列表的间距是通过 div.semi-tabs-bar-arrow 上的 margin-left/right 来实现的,而在存在溢出元素时,div.semi-tabs-bar-arrow 显示,margin 出现,在没有溢出元素时,div.semi-tabs-bar-arrow 不显示,margin 也不会出现,最终导致 tab 列表的宽度发生变化,这也是导致 tab scrollIntoView 之后显示不完全的根本原因

if (isEmpty(items)) {
return (
<Button
disabled={true}
icon={icon}
theme="borderless"
/>
);
}

<div role="presentation" className={arrowCls} onClick={(e): void => this.handleArrowClick(items, pos)}>
<Button
disabled={disabled}
icon={icon}
// size="small"
theme="borderless"
/>
</div>

/
1716209420083
1716209449812

更新日志

🇨🇳 Chinese

  • Fix: 修复 tab 在 scrollIntoView 后显示不完整的问题

🇺🇸 English

  • Fix: Fixed the issue where the tab was not fully displayed when scrolled into view.

检查清单

  • 已增加测试用例或无须增加
  • 已补充文档或无须补充
  • Changelog已提供或无须提供

其他要求

  • 本条 PR 不需要纳入 Changelog

附加信息

Before

2024-05-20.20-47-07.mp4

After

2024-05-20.21-03-49.mp4

Copy link

codesandbox-ci bot commented May 20, 2024

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit b979802:

Sandbox Source
pr-story Configuration

@pointhalo pointhalo requested a review from YannLynn May 28, 2024 08:07
@YannLynn YannLynn merged commit 0837b0f into DouyinFE:main Jun 3, 2024
6 of 7 checks passed
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

Successfully merging this pull request may close these issues.

2 participants