taro icon indicating copy to clipboard operation
taro copied to clipboard

ScrollView 中 scrollIntoViewAlignment = 'center' , 赋值 scrollIntoView 之后 item 不会滚到屏幕中间

Open liu-jin-yi opened this issue 1 year ago • 4 comments

相关平台

微信小程序

小程序基础库: 2.32.2 使用框架: React

复现步骤

<ScrollView scrollY scrollWithAnimation className={classNames(styles.index)} onScrollToLower={handleLoadMore} lowerThreshold={600} scrollIntoView={getId(lastCreatedScheduleId)} scrollIntoViewAlignment='center' >

期望结果

设置了 scrollIntoViewAlignment = 'center' 之后,item 滚动到屏幕中间

实际结果

设置了 scrollIntoViewAlignment = 'center' 之后,item 却滚动到屏幕 start

环境信息

👽 Taro v3.6.8


  Taro CLI 3.6.8 environment info:
    System:
      OS: macOS 10.14.5
      Shell: 3.2.57 - /bin/bash
    Binaries:
      Node: 16.19.1 - /usr/local/bin/node
      Yarn: 1.22.10 - /usr/local/bin/yarn
      npm: 8.19.3 - /usr/local/bin/npm
    npmPackages:
      @tarojs/cli: 3.6.8 => 3.6.8 
      @tarojs/components: 3.6.8 => 3.6.8
      @tarojs/helper: 3.6.8 => 3.6.8
      @tarojs/mini-runner:3.6.8 => 3.6.8
      @tarojs/plugin-framework-react: 3.6.8 => 3.6.8
      @tarojs/plugin-platform-weapp: 3.6.8 => 3.6.8
      @tarojs/react: 3.6.8 => 3.6.8
      @tarojs/router: 3.6.8 => 3.6.8
      @tarojs/runtime: 3.6.8=>3.6.8
      @tarojs/shared:3.6.8 => 3.6.8
      @tarojs/taro: 3.6.8 => 3.6.8
      @tarojs/webpack-runner: 3.6.8 => 3.6.8
      @tarojs/webpack5-runner: 3.6.8=> 3.6.8
      babel-preset-taro: 3.6.8 => 3.6.8
      eslint-config-taro: 3.6.8=> 3.6.8
      react: ^18.2.0 => 18.2.0 

liu-jin-yi avatar Jun 16 '23 07:06 liu-jin-yi