jd-opensource / jd-opensource/taro-ui
AtIndexes飞书小程序兼容性问题
- Dominant language
- TypeScript
- Stars
- 4.7k
- Forks
- 740
- PR merge metrics
- No merged PRs in 30d
Description
### Taro UI 版本信息
2.3.1
### 问题描述
Taro编译成飞书小程序的时候有时候组件的变量获取不到,现在AtIndexes组件ScrollView里面的`scrollTop={isWEB ? _scrollTop : undefined}
scrollIntoView={!isWEB ? _scrollIntoView : ''}`两个变量都获取不到,导致编译成飞书小程序的索引无法滑动,滑动后立即跳转到顶部
### 复现步骤
引入索引,编译成飞书小程序运行
### 复现代码
```
import { View } from '@tarojs/components'
import Taro from '@tarojs/taro'
import { AtIndexes } from 'taro-ui'
function Index() {
const list = [{
title: 'A',
key: 'A',
items: [
{
'name': '阿坝'
},
{
'name': '阿拉善'
}]
},
{
title: 'B',
key: 'B',
items: [
{
'name': '北京'
},
{
'name': '保定'
},
]
}
]
return (
自定义内容
)
}
export default Index
```
### 报错信息
列表超出屏幕时无法正常滚动
### 系统信息
👽 Taro v2.0.7
Taro CLI 2.0.7 environment info:
System:
OS: macOS 10.15.3
Shell: 5.7.1 - /bin/zsh
Binaries:
Node: 12.4.0 - /usr/local/bin/node
Yarn: 1.21.0 - /usr/local/bin/yarn
npm: 6.9.0 - /usr/local/bin/npm
npmPackages:
@tarojs/components: 2.0.7 => 2.0.7
@tarojs/components-rn: 2.0.7 => 2.0.7
@tarojs/mini-runner: 2.0.7 => 2.0.7
@tarojs/plugin-babel: 2.0.7 => 2.0.7
@tarojs/plugin-csso: 2.0.7 => 2.0.7
@tarojs/plugin-sass: 2.0.7 => 2.0.7
@tarojs/plugin-uglifyjs: 2.0.7 => 2.0.7
@tarojs/router: 2.0.7 => 2.0.7
@tarojs/taro: 2.0.7 => 2.0.7
@tarojs/taro-alipay: 2.0.7 => 2.0.7
@tarojs/taro-h5: 2.0.7 => 2.0.7
@tarojs/taro-qq: 2.0.7 => 2.0.7
@tarojs/taro-quickapp: 2.0.7 => 2.0.7
@tarojs/taro-redux-rn: 2.0.7 => 2.0.7
@tarojs/taro-rn: 2.0.7 => 2.0.7
@tarojs/taro-router-rn: 2.0.7 => 2.0.7
@tarojs/taro-swan: 2.0.7 => 2.0.7
@tarojs/taro-tt: 2.0.7 => 2.0.7
@tarojs/taro-weapp: 2.0.7 => 2.0.7
@tarojs/webpack-runner: 2.0.7 => 2.0.7
eslint-config-taro: 2.0.7 => 2.0.7
eslint-plugin-taro: 2.0.7 => 2.0.7
nerv-devtools: ^1.5.6 => 1.5.6
nervjs: ^1.5.6 => 1.5.6
react: 16.3.1 => 16.3.1
react-native: 0.55.4 => 0.55.4
stylelint-config-taro-rn: 2.0.7 => 2.0.7
stylelint-taro-rn: 2.0.7 => 2.0.7
npmGlobalPackages:
typescript: 3.6.4
### 补充信息
只要把!isWEB ? _scrollIntoView : ''等变量在return之前先赋给另一个变量,ScrollView就能从另一个变量获取到值了
Contributor guide
Research direction
Start with the AtIndexes component and its ScrollView bindings for scrollTop and scrollIntoView, then reproduce the issue by compiling the provided example for a Feishu mini program. Trace why the values are unavailable in the returned markup. Done means the index list scrolls correctly and does not jump back to the top after scrolling.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100