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

[ScrollablePositionedList] Scrollbar unexpected jumping #511

Open
hgraceb opened this issue Dec 28, 2023 · 2 comments
Open

[ScrollablePositionedList] Scrollbar unexpected jumping #511

hgraceb opened this issue Dec 28, 2023 · 2 comments

Comments

@hgraceb
Copy link

hgraceb commented Dec 28, 2023

Problem description

Scrollbar unexpected jumping when the initial scroll index is large.

Steps to reproduce

  1. Set initialScrollIndex to 99.
  2. Scroll to index 0.
  3. Click on the scrollbar to slide down.
import 'dart:ui';

import 'package:flutter/material.dart';
import 'package:scrollable_positioned_list/scrollable_positioned_list.dart';

void main() {
  runApp(
    MaterialApp(
      debugShowCheckedModeBanner: false,
      scrollBehavior: const MaterialScrollBehavior().copyWith(
        dragDevices: PointerDeviceKind.values.toSet(),
      ),
      home: Scaffold(
        body: ScrollablePositionedList.builder(
          itemCount: 100,
          itemBuilder: (context, index) => ListTile(title: Text('Item $index')),
          initialScrollIndex: 99,
        ),
      ),
    ),
  );
}

Expected behavior

The list scrolls to the end slowly.

Actual behavior

The list jumps to the end immediately.

Environment

[√] Flutter (Channel stable, 3.13.9, on Microsoft Windows [版本 10.0.19045.3570], locale zh-CN)
• Flutter version 3.13.9 on channel stable at D:\Temporary\flutter\_flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision d211f42860 (9 weeks ago), 2023-10-25 13:42:25 -0700
• Engine revision 0545f8705d
• Dart version 3.1.5
• DevTools version 2.25.0

[√] Windows Version (Installed version of Windows is version 10 or higher)

[√] Android toolchain - develop for Android devices (Android SDK version 33.0.0)
• Android SDK at C:\Users\Flop\AppData\Local\Android\sdk
• Platform android-34, build-tools 33.0.0
• Java binary at:
C:\Users\Flop\AppData\Local\JetBrains\Toolbox\apps\AndroidStudio\ch-0\222.4459.24.2221.9862592\jbr\bin\java
• Java version OpenJDK Runtime Environment (build 17.0.6+0-b2043.56-9586694)
• All Android licenses accepted.

[√] Chrome - develop for the web
• Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe

[√] Visual Studio - develop Windows apps (Visual Studio Community 2019 16.11.18)
• Visual Studio at C:\Program Files (x86)\Microsoft Visual Studio\2019\Community
• Visual Studio Community 2019 version 16.11.32802.440
• Windows 10 SDK version 10.0.19041.0

[√] Android Studio (version 2021.3)
• Android Studio at C:\Program Files\Android\Android Studio
• Flutter plugin can be installed from:
https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 11.0.13+0-b1751.21-8125866)

[√] Android Studio (version 2022.2)
• Android Studio at C:\Users\Flop\AppData\Local\JetBrains\Toolbox\apps\AndroidStudio\ch-0\222.4459.24.2221.9862592
• Flutter plugin version 76.0.1
• Dart plugin version 222.4582
• Java version OpenJDK Runtime Environment (build 17.0.6+0-b2043.56-9586694)

[√] VS Code, 64-bit edition (version 1.76.2)
• VS Code at C:\Program Files\Microsoft VS Code
• Flutter extension can be installed from:
https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter

[√] Connected device (3 available)
• Windows (desktop) • windows • windows-x64    • Microsoft Windows [版本 10.0.19045.3570]
• Chrome (web)      • chrome  • web-javascript • Google Chrome 119.0.6045.200
• Edge (web)        • edge    • web-javascript • Microsoft Edge 120.0.2210.91

[√] Network resources
• All expected network resources are available.

• No issues found!

Additional details

scrollbar

@rodolfogoulart
Copy link

I am having the almost the same problem, but i noted that is when using the keyboard, the scroll unexpected jumping to the end when using the keyboard UP and DOWN.

Steps to reproduce

when you press DOWN and UP in sequence, and press DOWN after, the list jump to the end imediaty.

@lijiankun24
Copy link

same issue, may I ask if this problem has been solved

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

3 participants