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

Tabs active动态改变van-tabs__line会有bug #601

Closed
1 of 7 tasks
coding-ice opened this issue Jan 4, 2024 · 3 comments
Closed
1 of 7 tasks

Tabs active动态改变van-tabs__line会有bug #601

coding-ice opened this issue Jan 4, 2024 · 3 comments

Comments

@coding-ice
Copy link
Contributor

coding-ice commented Jan 4, 2024

这个 Issue 涉及以下平台:

  • 微信小程序
  • 支付宝小程序
  • 百度小程序
  • 头条小程序
  • 快手小程序
  • QQ 轻应用
  • Web 平台(H5)

BUG 描述
同:#596

复现步骤

function DemoBar() {
  const [active, setActive] = useState('a')

  useEffect(() => {
    setTimeout(() => {
      setActive('c')
    }, 500)
  }, [])

  return (
    <Tabs active={active}>
      <Tab title="a" name="a">
        内容 1
      </Tab>
      <Tab title="b" name="b">
        内容 2
      </Tab>
      <Tab title="c" name="c">
        内容 3
      </Tab>
      <Tab title="d" name="d">
        内容 4
      </Tab>
    </Tabs>
  )
}

期望结果

实际结果

截图
image

环境

附加信息

@coding-ice
Copy link
Contributor Author

@zuolung

@json-q
Copy link

json-q commented Jan 7, 2024

同问题,此 bug 不是每次都可以复现,但复现概率也不算小。
使用场景:
左侧列表,右侧表单,表单填写完调用 setActive 的方法切换至列表 tab。
问题:
虽然视图为列表,但是 tab 的选中项还是表单。

@coding-ice
Copy link
Contributor Author

还是比较严重的问题,场景比较多的

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

3 participants