flet
flet copied to clipboard
bug: The same control in Tabs cannot update data synchronously
Duplicate Check
- [x] I have searched the opened issues and there are no duplicates
Describe the bug
When placing the same control in two TabBarViews of Tabs, only the last control will be modified when changing its value (theoretically, they should have the same value)
Code sample
Code
import flet as ft
def main(page: ft.Page):
test_input = ft.TextField()
page.add(
ft.Tabs(
selected_index=1,
length=2,
expand=True,
content=ft.Column(
expand=True,
controls=[
ft.TabBar(tabs=[ft.Tab(label="Tab 1"), ft.Tab(label="Tab 2")]),
ft.TabBarView(
expand=True,
controls=[ft.Container(content=test_input), ft.Container(content=test_input)],
),
],
),
)
)
if __name__ == "__main__":
ft.run(main)
To reproduce
Steps to reproduce: 1.Run the repro code. 2.Input any value in the input box of Tab 1, switch to Tab 2, and there is a value in the box of Tab 2. However, when switching back to Tab 1, there is no value in Tab 1.
Expected behavior
The TextFields in Tab 1 and Tab 2 display the same value
Screenshots / Videos
Captures
[Upload media here]
Operating System
Windows
Operating system details
Windows 11
Flet version
0.70.0.dev6833
Regression
I'm not sure / I don't know
Suggestions
No response
Logs
Logs
[Paste your logs here]
Additional details
No response