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

Infinite Scrolling issue of Dashboard #39

Open
rohanjariwala03 opened this issue Feb 6, 2024 · 5 comments
Open

Infinite Scrolling issue of Dashboard #39

rohanjariwala03 opened this issue Feb 6, 2024 · 5 comments

Comments

@rohanjariwala03
Copy link
Contributor

I don't know it's known issue or not in Dashboard package.

Issue

  • When you drag with mouse from mid to bottom of the screen. It started scrolling automatically.
  • It's working perfectly when autoScroll: false, . but if I make auto scroll false then If I want to move widget down then It's not scrolling.
  • Checkout attached video for more details.
Screen.Recording.2024-02-06.at.11.34.18.AM.mov
@rohanjariwala03
Copy link
Contributor Author

@Mehmetyaz @yazmehmet when I look into the code. I found one bug, which is even though there is no widget hold by user still it's calling OnPanUpdate method of Dashboard_stack.dart file.

and that file starting the speed. So, in my opinion, we need to add a condition that, if widget is grabbed then we need to start speed.

@uberchilly
Copy link
Contributor

uberchilly commented Feb 22, 2024

The same can be observed on mobile when you hold resize handle to left or right and start moving finger from top to bottom, it starts described infinite scroll. And when you trick it like this

  void scroll() {
    SchedulerBinding.instance.addPostFrameCallback((timeStamp) {
      try {
        if (speed != 0) {
          var n = pixels + speed;

          viewportOffset.jumpTo(n.clamp(0.0, (1 << 31).toDouble()));
          scroll();
        }
      } catch (e) {
        rethrow;
      }
    });
  }

Nothing is stopping this recursion to keep going becase move end is not detected to set speed = 0

@uberchilly
Copy link
Contributor

You can see a fix here in my fork of the repo -> uberchilly@a6d236d#diff-fda800d8e5251735122b4d1de71e2c89b9ce318c3e1719330aa502985140da0cL476

@Jayasubin
Copy link

You can see a fix here in my fork of the repo -> uberchilly@a6d236d#diff-fda800d8e5251735122b4d1de71e2c89b9ce318c3e1719330aa502985140da0cL476

can you create a merge request so that everyone can get the fix?

@uberchilly
Copy link
Contributor

uberchilly commented May 14, 2024

Here is the pull request #46

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