Skip to content

Scroll gets stuck when using scrollbar or dragging touch #3963

Description

@IndiePix

Duplicate Check

Describe the bug

When running the app in standalone mode, the scrollbar gets stuck and unresponsive (it makes little jumps each time you drag it). The same happens when you touch scroll by swiping up or down, it moves an step and stops abruptly.

Note 1: Scrolling works fine and smoothly in WEB BROWSER mode, it only happens when running as an standalone app.
Note 2: Scrolling with the mousewheel also works fine.

Code sample

Code
import flet as ft

def main(page: ft.Page):
    page.title = "GridView Example"
    page.theme_mode = ft.ThemeMode.DARK
    page.padding = 50
    page.update()

    images = ft.GridView(
        expand=1,
        runs_count=5,
        max_extent=150,
        child_aspect_ratio=1.0,
        spacing=5,
        run_spacing=5,
    )

    page.add(images)

    for i in range(0, 60):
        images.controls.append(
            ft.Image(
                src=f"https://picsum.photos/150/150?{i}",
                fit=ft.ImageFit.NONE,
                repeat=ft.ImageRepeat.NO_REPEAT,
                border_radius=ft.border_radius.all(10),
            )
        )
    page.update()

ft.app(main)

To reproduce

  1. Run GridView example from Flet Docs in standalone mode
  2. Try to move the scrollbar or drag touch the screen to scroll through the grid
  3. Notice how it doesn't scroll smoothly and does little jumps / stucks each time an scroll action is triggered from the scrollbar or touch dragging.

Expected behavior

Smooth scroll when using the scrollbar or dragging touch (in this case with a touch screen on windows)

Screenshots / Videos

Screen capture:
Scrolltest_bug.mp4

Operating System

Windows

Operating system details

Windows 11

Flet version

0.24.1

Regression

Yes, it used to work in a previous Flet version (please specify the version in additional details)

Suggestions

No response

Logs

Logs
[Paste your logs here]

Additional details

In 0.23 the scrollbar worked smoothly but the touch dragging still had this bug.
In 0.24 neither of the two works.

Metadata

Metadata

Assignees

Type

No type

Projects

Status
✅ Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions