-
Notifications
You must be signed in to change notification settings - Fork 600
Open
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
When the window size changes, the ft.context.page.window cannot follow the change in time
Code sample
import flet as ft
import flet.canvas as cv
def main(page: ft.Page):
v_text = ft.Text()
def on_resize(e):
v_text.value = (
f"{e}\n, width={e.control.width}, height={e.control.height}, window_width={ft.context.page.window.width}"
)
page.update()
page.add(
v_text,
cv.Canvas(
width=float('inf'),
height=600,
shapes=[
cv.Circle(x=100, y=100, radius=50),
],
on_resize=on_resize,
),
)
ft.run(main)To reproduce
Steps to reproduce:
1.Run the repro code.
2.Drag the edge of the window to zoom the window. When it moves quickly, ft.context.page.window.width will not be updated in time.
Expected behavior
No response
Screenshots / Videos
Captures
[Upload media here]
Operating System
Windows
Operating system details
Windows 11
Flet version
0.70.0.dev6707
Regression
I'm not sure / I don't know
Suggestions
No response
Logs
Logs
[Paste your logs here]Additional details
No response
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working