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.05k stars 427 forks source link

Add Smooth Scrolling to Flet Windows App #2497

Open mpmp8i opened 8 months ago

mpmp8i commented 8 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 7 months ago

Bump

baebranch commented 3 months ago

+1

ndonkoHenri commented 3 months ago

Please share a visual output of the scrolling issue.

baebranch commented 2 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 2 months ago

+1

mpmp8i commented 2 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 3 weeks 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...