peng8350 / flutter_pulltorefresh

a widget provided to the flutter scroll component drop-down refresh and pull up load.
MIT License
2.7k stars 720 forks source link

ios 15系统的safari浏览器输入框被顶到顶部 #579

Open jiangyubao opened 2 years ago

jiangyubao commented 2 years ago

flutter版本:2.10

编译指令: cd flutter_pulltorefresh/example flutter create . flutter build web --pwa-strategy none --release --no-source-maps --no-pub --web-renderer html 复现方法:

  1. safari浏览器打开,进入qq聊天界面 image
  2. 点击输入框,多点击几次软键盘的“完成”,然后就复现了
image
Shamik07 commented 1 month ago

View this: flutter_pulltorefresh Pull Request #636

tldr;

ScrollConfiguration(
  behavior: ScrollConfiguration.of(context).copyWith(
    dragDevices: {
      PointerDeviceKind.touch,
      PointerDeviceKind.mouse,
      PointerDeviceKind.trackpad,
      PointerDeviceKind.stylus,
    },
  ),
  child: SmartRefresher(
    enablePullDown: true,
    header: WaterDropHeader(),
    enablePullUp: true,
    footer: CustomFooter(
      builder: (BuildContext context, LoadStatus mode) {
        Widget body;
        if (mode == LoadStatus.idle) {
          body = Text("pull up load");
        } else if (mode == LoadStatus.loading) {
          body = CupertinoActivityIndicator();
        } else if (mode == LoadStatus.failed) {
          body = Text("Load Failed! Click retry!");
        } else if (mode == LoadStatus.canLoading) {
          body = Text("release to load more");
        } else {
          body = Text("No more Data");
        }
        return Container(
          height: 55.0,
          child: Center(child: body),
        );
      },
    ),
    controller: _refreshController,
    onRefresh: _onRefresh, // Check example above for this method
    onLoading: _onLoading, // Check example above for this method
    child: Offstage(), // Replace with your own widget
  ),
);