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.61k stars 455 forks source link

Add Smooth Scrolling to Flet Windows App #2497

Open ghost opened 10 months ago

ghost commented 10 months ago

Problem To Be Solved

Currently, when using the drag scroll bar in Flet, the scrolling behavior is smooth and provides a good user experience. However, when scrolling by other means, the experience is not smooth, leading to a less than optimal user experience.

In-Scope

Implement smooth scrolling for Flet when using methods other than the drag scroll bar. It is important to note that this issue is specific to the Windows app, and the web app is not affected by this behavior.

YouCantCMe commented 9 months ago

Bump

baebranch commented 5 months ago

+1

ndonkoHenri commented 5 months ago

Please share a visual output of the scrolling issue.

baebranch commented 4 months ago

https://github.com/flet-dev/flet/assets/66740223/82141e0c-06b2-4a58-b2d1-ca16e1aabdb7

The mouse wheel scrolling is smooth and can scroll continuously but with the trackpad, scrolling is limited to just a few lines in any one direction per touch, then I have to lift my fingers off of the trackpad and touch it again to scrolling another few lines. This problem doesn't exist on the web app for me as well.

App Code:

import flet as ft

def main(page: ft.Page):
  lv = ft.ListView(expand=True, spacing=10)
  for i in range(100):
    lv.controls.append(ft.Text(f"Line {i}"))
  page.add(lv)

ft.app(target=main, view=ft.AppView.FLET_APP)
anamite commented 4 months ago

+1

ghost commented 4 months ago

Scrolling.Bug.mp4 The mouse wheel scrolling is smooth and can scroll continuously but with the trackpad, scrolling is limited to just a few lines in any one direction per touch, then I have to lift my fingers off of the trackpad and touch it again to scrolling another few lines. This problem doesn't exist on the web app for me as well.

App Code:

import flet as ft

def main(page: ft.Page):
  lv = ft.ListView(expand=True, spacing=10)
  for i in range(100):
    lv.controls.append(ft.Text(f"Line {i}"))
  page.add(lv)

ft.app(target=main, view=ft.AppView.FLET_APP)

I have this problem too

IndiePix commented 2 months ago

I feel this is a huge problem for Windows users that want to make touch responsive apps (still happening in 0.24). For the moment we are hosting flet in chrome but it is not ideal to embbed the application...

azhago commented 1 month ago

+1 Scrolling one line at a time with touchpad on desktop windows app. Scroll is ok with mouse wheel (in all cases) or when using webapp

ndonkoHenri commented 21 hours ago

Please give the latest Flet version a try.