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(tab): 修复滑块定位错误的问题 #781

Merged
merged 8 commits into from
Aug 30, 2022

Conversation

CodingOnStar
Copy link
Contributor

@CodingOnStar CodingOnStar commented Aug 19, 2022

#759

🤔 这个 PR 的性质是?

  • 日常 bug 修复

🔗 相关 Issue

#759

💡 需求背景和解决方案

tab超长滚动的时候,相关的滚动位置offset计算有误,现使用小程序原生的属性scroll-into-view进行替换

📝 更新日志

  • fix(Tab): 修复滑块定位错误的问题

☑️ 请求合并前的自查清单

⚠️ 请自检并全部勾选全部选项⚠️

  • 文档已补充或无须补充
  • 代码演示已提供或无须提供
  • TypeScript 定义已补充或无须补充
  • Changelog 已提供或无须提供

@anlyyao anlyyao linked an issue Aug 19, 2022 that may be closed by this pull request
@PengYYYYY PengYYYYY changed the title fix(tab): 使用原声的滚动属性scroll-into-view fix(tab): 使用原生的滚动属性scroll-into-view Aug 22, 2022
src/tabs/tabs.ts Outdated Show resolved Hide resolved
src/tabs/tabs.ts Outdated Show resolved Hide resolved
@waney
Copy link

waney commented Aug 23, 2022

咋不合并呢?

@LeeJim
Copy link
Collaborator

LeeJim commented Aug 26, 2022

我再看看

@LeeJim
Copy link
Collaborator

LeeJim commented Aug 26, 2022

首先,这么写是没什么问题的,甚至更简洁。
但我之前这么写,也知道可以这么写,但仍然这么写的目的是兼容其他框架,可以使用相同的算法。

@CodingOnStar
Copy link
Contributor Author

首先,这么写是没什么问题的,甚至更简洁。 但我之前这么写,也知道可以这么写,但仍然这么写的目的是兼容其他框架,可以使用相同的算法。

我之前询问过另外一位大佬是否需要改用scroll-into-view的时候,大概也猜到了现有方法是有特殊的目的。不过一直没有得到回复,所以就尝试提了一个PR看看

* develop: (24 commits)
  feat(test/empty): test/empty
  fix(coverage-badge): coverage-badge脚本支持win32平台
  test(search): add unit test
  test(switch): add unit test
  docs(footer): update coverage badge
  build: generate coverage badge correctly
  fix(tabbar): update demo
  test(toast): add unit test
  feat(toast): add event
  test(footer): update badge
  test(footer): add unit test
  test(steps): add unit test
  test(switch): add unit test
  test(switch): add unit test
  test(search): add unit test
  test(switch): add unit test
  chore: changelog's changes
  chore: publish 0.19.2
  fix(ImageViewer): fix the scale problem of imageViewer (Tencent#782)
  fix(Popup): zIndex moved to root node && update docs (Tencent#784)
  ...
点击后,前移动到视口中最左侧,然后右移一半,再向左移动一半tab的长度

Tencent#781
@CodingOnStar
Copy link
Contributor Author

CodingOnStar commented Aug 29, 2022

@LeeJim 改了一下现有的方法,每次点击后移动到container的最左侧,然后向右移动一半container的宽度,之后再向左移动tab长度的一半,看看现在这样可以吗
(PS:貌似有人没检查lint就提交了)

@LeeJim
Copy link
Collaborator

LeeJim commented Aug 29, 2022

好的。我看看

@LeeJim LeeJim changed the title fix(tab): 使用原生的滚动属性scroll-into-view fix(tab): 修复滑块定位错误的问题 Aug 30, 2022
Copy link
Collaborator

@LeeJim LeeJim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@LeeJim LeeJim merged commit d4c2ea5 into Tencent:develop Aug 30, 2022
@github-actions github-actions bot mentioned this pull request Sep 5, 2022
@TSiven
Copy link

TSiven commented Apr 17, 2023

还是存在这个问题, 正式版1.1.1

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