Skip to content

Control's widget is re-created if existing control's position changed #709

@FeodorFitsner

Description

@FeodorFitsner

In the following example the second update re-creates Flutter widget for c3 as its being assigned a new ID, however the control was just moved within controls collection and its ID is expected to be the same:

from time import sleep
import flet as ft

def main(page: ft.Page):

    c1 = ft.Container(bgcolor="yellow", width=50, height=50)
    c2 = ft.Container(bgcolor="blue", width=50, height=50)
    c3 = ft.Container(bgcolor="green", width=50, height=50)
    page.add(c1, c2, c3)
    sleep(1)
    page.controls.remove(c3)
    page.controls.insert(1, c3)
    page.update()

ft.app(target=main)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions