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

AtIndexes 跳转索引后会,稍等一会会返回顶部 #10006

Open
AimLuo opened this issue Aug 7, 2021 · 2 comments
Open

AtIndexes 跳转索引后会,稍等一会会返回顶部 #10006

AimLuo opened this issue Aug 7, 2021 · 2 comments
Labels
F-react Framework - React T-weapp Target - 编译到微信小程序 V-3 Version - 3.x

Comments

@AimLuo
Copy link

AimLuo commented Aug 7, 2021

相关平台

微信小程序

复现仓库

https://github.com/AimLuo/taro-ui-at-indexes
小程序基础库: 2.19.0
使用框架: React

复现步骤

代码如下:

const list = [
  {
    title: "A",
    key: "A",
    items: [
      {
        name: "阿坝",
        // 此处可加其他业务字段
      },
      {
        name: "阿拉善"
      }
    ]
  },
  {
    title: "B",
    key: "B",
    items: [
      {
        name: "北京"
      },
      {
        name: "保定"
      }
    ]
  },
  {
    title: "C",
    key: "C",
    items: [
      {
        name: "1"
      },
      {
        name: "2"
      }
    ]
  },
  {
    title: "D",
    key: "D",
    items: [
      {
        name: "3"
      },
      {
        name: "4"
      }
    ]
  },
  {
    title: "E",
    key: "E",
    items: [
      {
        name: "5"
      },
      {
        name: "6"
      }
    ]
  },
  {
    title: "F",
    key: "F",
    items: [
      {
        name: "5"
      },
      {
        name: "6"
      }
    ]
  },
  {
    title: "G",
    key: "G",
    items: [
      {
        name: "5"
      },
      {
        name: "6"
      }
    ]
  }
];
let fn = null;
export default function AA() {
  return (
    <View style={{ height: "100vh" }}>
      <AtIndexes
        animation
        onScrollIntoView={cfn => {
          fn = cfn;
        }}
        list={list}
      >
        <Button onClick={() => fn("G")}>dianwo</Button>
      </AtIndexes>
    </View>
  );
}
  1. 点击右侧导航标题,正确跳转后,稍等一会又会自动跳回顶部
  2. 通过 fn 主动跳转也是同样的问题

期望结果

正确跳转

实际结果

跳转错误

环境信息

aro CLI 3.3.2 environment info:
    System:
      OS: macOS 11.4
      Shell: 5.8 - /bin/zsh
    Binaries:
      Node: 14.15.0 - /usr/local/bin/node
      Yarn: 1.22.10 - /usr/local/bin/yarn
      npm: 6.14.8 - /usr/local/bin/npm
    npmPackages:
      @tarojs/cli: 3.3.2 => 3.3.2 
      @tarojs/components: 3.3.2 => 3.3.2 
      @tarojs/mini-runner: 3.3.2 => 3.3.2 
      @tarojs/react: 3.3.2 => 3.3.2 
      @tarojs/runtime: 3.3.2 => 3.3.2 
      @tarojs/taro: 3.3.2 => 3.3.2 
      @tarojs/webpack-runner: 3.3.2 => 3.3.2 
      babel-preset-taro: 3.3.2 => 3.3.2 
      eslint-config-taro: 3.3.2 => 3.3.2 
      react: ^17.0.0 => 17.0.2 
      taro-ui: ^3.0.0-alpha.3 => 3.0.0-alpha.10 
    npmGlobalPackages:
      typescript: 4.3.5

补充信息

使用 taro cli 初始化项目,其他未做任何更改。

@taro-bot2 taro-bot2 bot added F-react Framework - React T-weapp Target - 编译到微信小程序 V-3 Version - 3.x labels Aug 7, 2021
@AimLuo
Copy link
Author

AimLuo commented Aug 7, 2021

补充一下,在编译为H5时,连跳都不跳了

@taixiaojingyan
Copy link

你好,后来怎么弄好的?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
F-react Framework - React T-weapp Target - 编译到微信小程序 V-3 Version - 3.x
Projects
None yet
Development

No branches or pull requests

2 participants