flet-dev / flet

Flet enables developers to easily build realtime web, mobile and desktop apps in Python. No frontend experience required.
https://flet.dev
Apache License 2.0
11.02k stars 426 forks source link

Scroll gets stuck when using scrollbar or dragging touch #3963

Open IndiePix opened 2 weeks ago

IndiePix commented 2 weeks ago

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 ```python 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: https://github.com/user-attachments/assets/c26519b1-d525-405b-8ca1-6c2b917ae263

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 ```console [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.

Siva-Rajan-R commented 2 weeks ago

Yes bro same thing happens to me,Is there any solution for this

HenryNomeland commented 1 week ago

I am also getting this issue - would be nice to have a fix

ndonkoHenri commented 1 week ago

@Siva-Rajan-R @HenryNomeland please provide specifications (OS, Flet version etc).

YagamiKAI commented 1 week ago

this is true I am on Windows 11 64 bits I code with the latest versions python, flet, I can add to this recent bug the fact of not being able to use the mouse in horizontal scroll , on the other hand in webbview it works normally for the trackpad scroll, and the scroll bar for horisental mouse scroll too

YagamiKAI commented 1 week ago

adding to that thank you in advance for your incredible library

CDXC-55uh commented 1 week ago

Comment The same for me.

Android: On Android, in the Flet app, it works smoothly.

Windows 11: On Windows 11 in the desktop version, scrolling jumps only once by a small amount when moving up or down. The same thing happens when I try to scroll with my finger on the touch screen.

Operating System Windows

Operating system details Windows 11

Flet version 0.24.1

Siva-Rajan-R commented 1 week ago

@HenryNomeland windows 10 , flet 0.24.1

DavidFraifer commented 1 week ago

Same for me.

While dragging it stops, and only jums when you click other place of the scroll.

https://github.com/user-attachments/assets/136dafb4-5631-495d-8eed-c07354e15417

Operating system details Windows 11

Flet version 0.24.1