Skip to content

Error when removing and inserting Control from/to Row Controls #3518

Answered by ndonkoHenri
Swastik2442 asked this question in Q&A
Discussion options

You must be logged in to vote

Interesting topic.

I came up with a simple repro:

import flet as ft


def main(page: ft.Page):
    def handle_add(e):
        t = c.controls.pop(0)
        print(f"After Pop: {type(t.page)}")

        c.controls.append(t)
        c.update()
        print(f"After Append+Update: {type(t.page)}\n")

    page.add(
        ft.OutlinedButton("Trigger", on_click=handle_add),
        c := ft.Column(
            [
                ft.TextButton(
                    "1", on_hover=lambda e: print(f"OnHover: {type(e.control.page)}")
                ),
                ft.TextButton(
                    "2", on_hover=lambda e: print(f"OnHover: {type(e.control.page)}")
                ),
                ft.

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@Swastik2442
Comment options

@ndonkoHenri
Comment options

@Swastik2442
Comment options

Answer selected by Swastik2442
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
help wanted Extra attention is needed
2 participants