-
Notifications
You must be signed in to change notification settings - Fork 590
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Duplicate Check
- I have searched the opened issues and there are no duplicates
Describe the bug
failed update control, when append control with key to existing controls
Code sample
Code
import flet as ft
def main(page):
def item(key) -> ft.Container:
def change_bgcolor(e: ft.Event[ft.Container]):
e.control.bgcolor = ft.Colors.GREY
return ft.Container(
ft.Text(key),
width=100, height=100, bgcolor=ft.Colors.GREEN,
on_click=change_bgcolor,
key=ft.ScrollKey(key), # Work Fine Without Key
)
def add_new():
grid.controls.append(item(len(grid.controls)))
grid = ft.ResponsiveRow(
controls=[item(0), item(1), ]
)
page.add(ft.Column([
ft.Row([ft.Button("New", on_click=add_new)]),
grid
]))
if __name__ == '__main__':
ft.run(
main=main
)item with key > 1 not update
To reproduce
- run code
- click add new
- click on Container to change bgcolor
Expected behavior
No response
Screenshots / Videos
Captures
[Upload media here]
Operating System
Windows
Operating system details
win 11
Flet version
flet[all]>=0.70.0.dev6561
Regression
No, it isn't
Suggestions
No response
Logs
Logs
[Paste your logs here]Additional details
No response
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working