You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have searched the opened issues and there are no duplicates
Describe the bug
The documentation here suggests that controls designated as isolated should ignore their children when updated. This would be potentially useful when e.g. having components that are expensive to update and you want to schedule those updates manually explicitly.
Unfortunately it seems like this is not how it actually works. Here we see how if the isolated argument was passed, it would skip updating the children:
It's an easy enough fix but I was wondering whether there was a reason for this. I've currently gone around it in my custom component by overriding build_update_commands, but that's obviously hackish.
See the above code sample; try commenting out the override of the build_update_commands and note how the content of the widget keeps updating on each open/close.
Expected behavior
Components on which the .isolated property is set to True, or the .is_isolated() method returns True, should not update their children automatically.
Duplicate Check
Describe the bug
The documentation here suggests that controls designated as isolated should ignore their children when updated. This would be potentially useful when e.g. having components that are expensive to update and you want to schedule those updates manually explicitly.
https://flet.dev/docs/getting-started/custom-controls/#isolated-controls
Unfortunately it seems like this is not how it actually works. Here we see how if the
isolated
argument was passed, it would skip updating the children:flet/sdk/python/packages/flet/src/flet/core/control.py
Lines 398 to 407 in f8c7baa
And here we see how it's never set and thus always defaults to False:
flet/sdk/python/packages/flet/src/flet/core/page.py
Lines 813 to 816 in f8c7baa
Also the control itself doesn't really make use of the
isolated
property:flet/sdk/python/packages/flet/src/flet/core/control.py
Lines 83 to 84 in f8c7baa
It's an easy enough fix but I was wondering whether there was a reason for this. I've currently gone around it in my custom component by overriding
build_update_commands
, but that's obviously hackish.Code sample
Code
To reproduce
See the above code sample; try commenting out the override of the
build_update_commands
and note how the content of the widget keeps updating on each open/close.Expected behavior
Components on which the
.isolated
property is set to True, or the.is_isolated()
method returns True, should not update their children automatically.Screenshots / Videos
Captures
[Upload media here]
Operating System
Linux
Operating system details
Ubuntu 22.04, on WSL2
Flet version
Observed in 0.22.1, persists as of 0.26.0
Regression
I'm not sure / I don't know
Suggestions
Simply change the code in
page.py
to:Logs
Logs
[Paste your logs here]
Additional details
No response
The text was updated successfully, but these errors were encountered: