flet-dev / flet

Flet enables developers to easily build realtime web, mobile and desktop apps in Python. No frontend experience required.

Home Page:https://flet.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ScrollMode.ALWAYS probably works incorrect

sagittarius-H opened this issue · comments

Description

If I activate scrolling for a column and set ScrollMode.ALWAYS and at the same time add only one or some elements to the column whose height is less than the height of the column itself, then the scrollbar is not displayed.

Code example to reproduce the issue:

import flet

def main(page:flet.Page):
    page.title = "Scroll Column Test"
    column = flet.Container(
        content=flet.Column(
            width=200,
            height=200,
            scroll=flet.ScrollMode.ALWAYS,
            # controls=[flet.Text(value=str(i)) for i in range(100)]
            controls=[flet.Text(value="single string",height=20)]
            ),
        theme=flet.Theme(
            scrollbar_theme=flet.ScrollbarTheme(
                track_color={
                    flet.MaterialState.DEFAULT: "#E3E7E8",
                },
                track_visibility=True,
                thumb_color={
                    flet.MaterialState.DEFAULT: "#616161",
                },
                radius=10,
                main_axis_margin=10
            )
        )
    )
    page.add(column)


if __name__ == "__main__":
    flet.app(target=main)

Describe the results you received:

Vertical scrollbar is not displayed

Describe the results you expected:
Vertical scrollbar should be visible, but inactive

Flet version (pip show flet):

Name: flet
Version: 0.22.0
Summary: Flet for Python - easily build interactive multi-platform apps in Python
Home-page: 
Author: Appveyor Systems Inc.
Author-email: hello@flet.dev
License: Apache-2.0
Location: C:\Users\HermanC\PycharmProjects\flet-Learn\venv\Lib\site-packages
Requires: cookiecutter, fastapi, flet-runtime, packaging, qrcode, uvicorn, watchdog
Required-by:

Give your requirements.txt file (don't pip freeze, instead give direct packages):

flet==0.22.0

Operating system:

Windows 11 21H2

Looks like same issue, but for ScrollMode.HIDDEN - #2388