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使用vertical 和title-scroll 如何title 过多时 点击下一条时不能向下滚动,反而向上滚动 #2726

Closed
ecshoper opened this issue Dec 11, 2023 · 0 comments · Fixed by #2996
Labels
bug reproducible 提供了可复现代码,或者已验证可复现
Milestone

Comments

@ecshoper
Copy link

ecshoper commented Dec 11, 2023

NutUI 包名

@nutui/nutui-taro

NutUI 版本号

4.2.3

平台

h5, weapp

重现链接

暂无

重现步骤

代码

<template>
  <nut-tabs
    v-model="value"
    style="height: 80%"
    title-scroll
    title-gutter="10"
    name="tabName"
    direction="vertical"
    :animated-time="0"
  >
    <nut-tab-pane v-for="item in list" :title="'Tab ' + item" :pane-key="item">1111</nut-tab-pane>
  </nut-tabs>
</template>
<script setup lang="ts">
import { ref } from 'vue';
const value = ref('0');

const list = new Array(40).fill(0).map((_, index) => index);
definePageConfig({
  navigationBarTitleText: '个人中心'
});
</script>

<style lang="scss"></style>

tabs使用vertical 和title-scroll 如何title 过多时 点击下一条时不能向下滚动,反而向上滚动
出问题的代码 应该是在Tabs.js
中的
const top = titleRects.slice(0, currentIndex.value).reduce((prev, curr) => prev + curr.height + 0, DEFAULT_PADDING);
将 prev + curr.height + 0, 改成 prev + curr.height + 20时 就正常了

期望的结果是什么?

点击下一条向下滚动

实际的结果是什么?

向上滚动

环境信息

其他补充信息

@eiinu eiinu added bug PR Welcome 已确认存在的问题,或者计划实现的功能,欢迎社区 PR labels Dec 18, 2023
@eiinu eiinu added this to the v4.3.5 milestone Mar 26, 2024
@eiinu eiinu added reproducible 提供了可复现代码,或者已验证可复现 and removed PR Welcome 已确认存在的问题,或者计划实现的功能,欢迎社区 PR labels Mar 26, 2024
@eiinu eiinu modified the milestones: v4.3.5, v4.3.4 Mar 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug reproducible 提供了可复现代码,或者已验证可复现
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants