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

ScrollView在H5中拨动区域外才能滑动 #3457

Closed
zhuxianguo opened this issue Jun 17, 2019 · 5 comments
Closed

ScrollView在H5中拨动区域外才能滑动 #3457

zhuxianguo opened this issue Jun 17, 2019 · 5 comments

Comments

@zhuxianguo
Copy link
Contributor

zhuxianguo commented Jun 17, 2019


问题描述
ScrollView在H5中拨动区域外才能滑动

复现步骤

import Taro, { Component } from '@tarojs/taro'
import { View, Text, ScrollView } from '@tarojs/components'

export default class Index extends Component {

  config = {
    navigationBarTitleText: '首页',
    enablePullDownRefresh: true
  }

  componentWillMount() { }

  componentDidMount() { }

  componentWillUnmount() { }

  componentDidShow() { }

  componentDidHide() { }

  onScrollToLower(e) {
    console.log('onScrollToLower', e)
  }
  onPullDownRefresh(e) {
    console.log('onPullDownRefresh', e)
    setTimeout(() => {
      Taro.stopPullDownRefresh()
    }, 1000)
  }
  render() {
    const scrollStyle = {
        width:'300px',
      height: '400px',
      'background-color': 'rgb(26, 50, 25)'
    }
    const vStyleA = {
        width:'100px',
      height: '150px',
      'background-color': 'rgb(26, 173, 25)'
    }
    const vStyleB = {
        width:'150px',
        height: '150px',
      'background-color': 'rgb(39,130,215)'
    }
    const vStyleC = {
        width:'150px',
        height: '150px',
      'background-color': 'rgb(241,241,241)',
      color: '#333'
    }
    return (
      <ScrollView
        scrollY
        style={scrollStyle}
        upperThreshold={20}
        onScrollToLower={this.onScrollToLower}
      >
        <View style={vStyleA}>A</View>
        <View style={vStyleB}>B</View>
        <View style={vStyleC}>C</View>
      </ScrollView>
    )
  }
}

期望行为
期望拨动ScrollView区域可滑动

报错信息
QQ截图20190617164545

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

补充信息

@taro-bot
Copy link

taro-bot bot commented Jun 17, 2019

欢迎提交 Issue~

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

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

Good luck and happy coding~

@zhuxianguo
Copy link
Contributor Author

QQ截图20190617170830
发现y移除此事件后就正常了,但不知如何修正此问题

@jinjinjin0731
Copy link
Contributor

升级到 1.3.2 试试。 在 1.3.2 中没有复现

@taro-bot
Copy link

taro-bot bot commented Jun 19, 2019

Hello~

您的问题楼上已经有了确切的回答,如果没有更多的问题这个 issue 将在 15 天后被自动关闭。

如果您在这 15 天中更新更多信息自动关闭的流程会自动取消,如有其他问题也可以发起新的 Issue。

Good luck and happy coding~

@taro-bot taro-bot bot removed the to be closed label Jul 4, 2019
@taro-bot taro-bot bot closed this as completed Jul 4, 2019
@zhuxianguo
Copy link
Contributor Author

zhuxianguo commented Jul 10, 2019

`import Taro, { Component } from '@tarojs/taro'
import { ScrollView } from '@tarojs/components'

export default class PageView extends Component {
constructor() {
super(...arguments)
}

onScrollToUpper(e){
console.log(e.detail)
}

onScroll(e){
console.log(e.detail)
}

render() {
const scrollStyle = {
height: '150px'
}
const scrollTop = 0
const Threshold = 20
const vStyleA = {
height: '150px',
'background-color': rgb(26, 173, 25)
}
const vStyleB = {
height: '150px',
'background-color': rgb(39,130,215)
}
const vStyleC = {
height: '150px',
'background-color': rgb(241,241,241),
color: '#333'
}
return (

A
B
C

)
}
}`
编译成后小程序
ScrollView外才能拖动,ScrollView区域内不能拖动,期望ScrollView也能拖动
版本1.3.5,感觉这个问题反反复复好多遍了呀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants