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 的 refresherTriggered 功能无效 #9268

Closed
cyzeng-Luca opened this issue May 7, 2021 · 2 comments
Closed

ScrollView 的 refresherTriggered 功能无效 #9268

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

Comments

@cyzeng-Luca
Copy link

cyzeng-Luca commented May 7, 2021

相关平台

微信小程序

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

复现步骤

小程序源生片段:https://developers.weixin.qq.com/s/cHkmm7mC7kqi
Taro代码

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

import './index.scss';

export default class PageView extends Component {
  state = {
    triggered: false,
  };

  onRefresh = () => {
    if (this._freshing) return;
    this._freshing = true;
    setTimeout(() => {
      this.setState({
        triggered: false,
      });
      this._freshing = false;
    }, 3000);
  };

  render() {
    const { triggered } = this.state;

    return (
      <ScrollView
        scrollY
        style='width: 100%; height: 400px;'
        refresherEnabled
        refresherThreshold={100}
        refresherTriggered={triggered}
        onRefresherRefresh={this.onRefresh}
        // 打开注释之后,可以实现完成下拉刷新操作
        // onRefresherPulling={() => {
        //   this.setState({
        //     triggered: true,
        //   });
        // }}
      >
        <View>1111</View>
      </ScrollView>
    );
  }
}

期望结果

refresherTriggered有效,

实际结果

refresherTriggered无效,无效的意思是手动下拉刷新之后,无法恢复最初状态,即下拉弹窗没有隐藏,依然正在刷新阶段,没有回弹。

环境信息

 Taro v3.2.5


  Taro CLI 3.2.5 environment info:
    System:
      OS: macOS 11.2.2
      Shell: 5.8 - /bin/zsh
    Binaries:
      Node: 14.9.0 - /usr/local/bin/node
      Yarn: 1.22.5 - /usr/local/bin/yarn
      npm: 6.14.6 - /usr/local/bin/npm
    npmPackages:
      @tarojs/cli: 3.2.6 => 3.2.6 
      @tarojs/components: 3.2.6 => 3.2.6 
      @tarojs/mini-runner: 3.2.6 => 3.2.6 
      @tarojs/react: 3.2.6 => 3.2.6 
      @tarojs/runtime: 3.2.6 => 3.2.6 
      @tarojs/taro: 3.2.6 => 3.2.6 
      @tarojs/webpack-runner: 3.2.6 => 3.2.6 
      babel-preset-taro: 3.2.6 => 3.2.6 
      eslint-config-taro: 3.2.6 => 3.2.6 
      react: ^16.10.0 => 16.14.0 

补充信息

历史issue #9235

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

MrArky commented Aug 24, 2021

每次下拉时,要将triggered设置为true

@MechaGirls
Copy link

vue3还是不支持这个refresherTriggered传值,好奇怪啊

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

3 participants