Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setting ListView child control's visibility to False breaks ListView #4966

Open
1 task done
jnsh opened this issue Feb 24, 2025 · 0 comments
Open
1 task done

Setting ListView child control's visibility to False breaks ListView #4966

jnsh opened this issue Feb 24, 2025 · 0 comments

Comments

@jnsh
Copy link

jnsh commented Feb 24, 2025

Duplicate Check

Describe the bug

Setting visibility=False on any number of ListView's child controls results in a glitch, where as if a big gray block was added to the end of the ListView. The ListView can be scrolled to show more of the gray block, and the ListView and it's child controls remain otherwise functional. Setting back visibility=True on all of the child controls corrects the behavior.

Code sample

Code
from time import sleep
import flet as ft

def main(page: ft.Page):
    page.title = "Auto-scrolling ListView"

    lv = ft.ListView(expand=1, spacing=10, padding=20)

    count = 1

    for i in range(0, 10):
        lv.controls.append(ft.Text(f"Line {count}"))
        count += 1

    page.add(lv)

    sleep(5)
    lv.controls[2].visible=False
    lv.update()

ft.app(main)

To reproduce

  1. Create ListView and add child controls of any type into it.
  2. Set visibility=False on any number of the child controls
  3. A big gray block appears at the bottom of the ListView

Expected behavior

ListView remains working as expected, without visual or functional issues, even if a child control is hidden with visibility=False

Screenshots / Videos

Captures

Image

Operating System

Linux

Operating system details

Rocky Linux 9.3

Flet version

0.27.1

Regression

No, it isn't

Suggestions

No response

Logs

Additional details

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant