File tree Expand file tree Collapse file tree
sdk/python/packages/flet/integration_tests/controls/core Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -71,3 +71,36 @@ async def test_zero_col_controls_are_hidden_at_breakpoint(
7171 ],
7272 ),
7373 )
74+
75+
76+ @pytest .mark .asyncio (loop_scope = "function" )
77+ async def test_scroll_to (flet_app : ftt .FletTestApp ):
78+ events = []
79+
80+ def on_scroll (e : ft .OnScrollEvent ):
81+ events .append (e )
82+
83+ flet_app .page .add (
84+ row := ft .ResponsiveRow (
85+ height = 120 ,
86+ width = 320 ,
87+ scroll = ft .ScrollMode .HIDDEN ,
88+ on_scroll = on_scroll ,
89+ controls = [
90+ ft .Container (
91+ col = 12 ,
92+ height = 70 ,
93+ bgcolor = ft .Colors .BLUE_50 ,
94+ content = ft .Text (f"Item { i } " ),
95+ )
96+ for i in range (6 )
97+ ],
98+ )
99+ )
100+ await flet_app .tester .pump_and_settle ()
101+
102+ await row .scroll_to (offset = 160 , duration = 0 )
103+ await flet_app .tester .pump_and_settle ()
104+
105+ assert events
106+ assert events [- 1 ].pixels > 0
You can’t perform that action at this time.
0 commit comments