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

Taro ScrollView的scrollIntoView X方向不能正确的跳转,Y方向正常 #4295

Closed
zhaitianye opened this issue Aug 26, 2019 · 10 comments
Closed
Assignees
Labels
A-components Area - H5 组件库相关 T-h5 Target - 编译到 H5 V-1 Version - 1.x

Comments

@zhaitianye
Copy link

问题描述
如题目所说,scrollIntoView X方向不能正确的跳转,应该是taro的一个bug。

复现步骤
[复现问题的步骤]
image
image

  render () {
    return (
      <View className={styles.container}>
        <ScrollView
          scrollX = {true}
          scrollIntoView={'F'}
          className={styles.ScrollView}
        >
          <View
            id='A'
            className={styles.item}
          >
            123
          </View>
          <View
            id='B'
            className={styles.item}
          >
            123
          </View>
          <View
            id='C'
            className={styles.item}
          >
            123
          </View>
          <View
            id='D'
            className={styles.item}
          >
            123
          </View>
          <View
            id='E'
            className={styles.item}
          >
            123
          </View><View
            id='F'
            className={styles.item}
          >
            15
          </View>
          <View
            id='G'
            className={styles.item}
          >
            123
          </View>
        </ScrollView>
      </View>
    )
  }
.container {  

  .ScrollView{
    width: 100%;
    // height: 100%;
    white-space: nowrap;

    .item{
      display: inline-block;
      width: 200px;
      height: 200px;
    }
  }
}

系统信息
Taro CLI 1.3.12 environment info:
System:
OS: Windows 10
Binaries:
Node: 10.15.3 - D:\software\nodejs\node.EXE
Yarn: 1.15.2 - C:\Program Files (x86)\Yarn\bin\yarn.CMD
npm: 6.4.1 - D:\software\nodejs\npm.CMD

@taro-bot
Copy link

taro-bot bot commented Aug 26, 2019

欢迎提交 Issue~

如果你提交的是 bug 报告,请务必遵循 Issue 模板的规范,尽量用简洁的语言描述你的问题,最好能提供一个稳定简单的复现。🙏🙏🙏

如果你的信息提供过于模糊或不足,或者已经其他 issue 已经存在相关内容,你的 issue 有可能会被关闭。

Good luck and happy coding~

@Chen-jj
Copy link
Contributor

Chen-jj commented Aug 26, 2019

@zhaitianye 哪个平台

@zhaitianye
Copy link
Author

@zhaitianye 哪个平台
H5

@taro-bot
Copy link

taro-bot bot commented Aug 26, 2019

CC @jinjinjin0731

@ZakaryCode
Copy link
Contributor

scrollIntoView 并没有 scrollY 或者是 scrollX 相关的区分,如果更新版本后依旧无法使用,可以尝试提交 demo

@sunflower8th
Copy link

小程序也有同样的 问题

@ZakaryCode
Copy link
Contributor

小程序也有同样的 问题

请认真阅读文档,查看组件使用方法。

备注,该问题已经关闭,如有类似问题可以提交新的 Issue 引用此问题。

@ghostogre
Copy link

同样的问题,scrollview会滚动会最左侧,文档内容无法解决

@talentjeff
Copy link

遇到同样的问题,按照文档说明设置id。被坑的心累

@Chen-jj
Copy link
Contributor

Chen-jj commented Mar 3, 2022

遇到同样的问题,按照文档说明设置id。被坑的心累

@talentjeff 重新开一个 issue 并附上 demo 咯

@ZakaryCode ZakaryCode added A-components Area - H5 组件库相关 V-1 Version - 1.x T-h5 Target - 编译到 H5 labels Mar 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-components Area - H5 组件库相关 T-h5 Target - 编译到 H5 V-1 Version - 1.x
Projects
Archived in project
Development

No branches or pull requests

7 participants