@@ -41,7 +41,7 @@ void testMain() {
4141 test ('The view is focusable but not reachable by keyboard when focused' , () async {
4242 final EngineFlutterView view = createAndRegisterView (dispatcher);
4343
44- view.dom.rootElement.focus ();
44+ view.dom.rootElement.focusWithoutScroll ();
4545
4646 // The root element should have a tabindex="-1" to make the flutter view
4747 // focusable but not reachable by the keyboard.
@@ -55,11 +55,11 @@ void testMain() {
5555 expect (view1.dom.rootElement.getAttribute ('tabindex' ), '0' );
5656 expect (view2.dom.rootElement.getAttribute ('tabindex' ), '0' );
5757
58- view1.dom.rootElement.focus ();
58+ view1.dom.rootElement.focusWithoutScroll ();
5959 expect (view1.dom.rootElement.getAttribute ('tabindex' ), '-1' );
6060 expect (view2.dom.rootElement.getAttribute ('tabindex' ), '0' );
6161
62- view2.dom.rootElement.focus ();
62+ view2.dom.rootElement.focusWithoutScroll ();
6363 expect (view1.dom.rootElement.getAttribute ('tabindex' ), '0' );
6464 expect (view2.dom.rootElement.getAttribute ('tabindex' ), '-1' );
6565
@@ -77,11 +77,11 @@ void testMain() {
7777 expect (view1.dom.rootElement.getAttribute ('tabindex' ), isNull);
7878 expect (view2.dom.rootElement.getAttribute ('tabindex' ), isNull);
7979
80- view1.dom.rootElement.focus ();
80+ view1.dom.rootElement.focusWithoutScroll ();
8181 expect (view1.dom.rootElement.getAttribute ('tabindex' ), isNull);
8282 expect (view2.dom.rootElement.getAttribute ('tabindex' ), isNull);
8383
84- view2.dom.rootElement.focus ();
84+ view2.dom.rootElement.focusWithoutScroll ();
8585 expect (view1.dom.rootElement.getAttribute ('tabindex' ), isNull);
8686 expect (view2.dom.rootElement.getAttribute ('tabindex' ), isNull);
8787
@@ -93,7 +93,7 @@ void testMain() {
9393 test ('fires a focus event - a view was focused' , () async {
9494 final EngineFlutterView view = createAndRegisterView (dispatcher);
9595
96- view.dom.rootElement.focus ();
96+ view.dom.rootElement.focusWithoutScroll ();
9797
9898 expect (dispatchedViewFocusEvents, hasLength (1 ));
9999
@@ -105,7 +105,7 @@ void testMain() {
105105 test ('fires a focus event - a view was unfocused' , () async {
106106 final EngineFlutterView view = createAndRegisterView (dispatcher);
107107
108- view.dom.rootElement.focus ();
108+ view.dom.rootElement.focusWithoutScroll ();
109109 view.dom.rootElement.blur ();
110110
111111 expect (dispatchedViewFocusEvents, hasLength (2 ));
@@ -123,12 +123,12 @@ void testMain() {
123123 final EngineFlutterView view1 = createAndRegisterView (dispatcher);
124124 final EngineFlutterView view2 = createAndRegisterView (dispatcher);
125125
126- view1.dom.rootElement.focus ();
127- view2.dom.rootElement.focus ();
126+ view1.dom.rootElement.focusWithoutScroll ();
127+ view2.dom.rootElement.focusWithoutScroll ();
128128 // The statements simulate the user pressing shift + tab in the keyboard.
129129 // Synthetic keyboard events do not trigger focus changes.
130130 domDocument.body! .pressTabKey (shift: true );
131- view1.dom.rootElement.focus ();
131+ view1.dom.rootElement.focusWithoutScroll ();
132132 domDocument.body! .releaseTabKey ();
133133
134134 expect (dispatchedViewFocusEvents, hasLength (3 ));
@@ -150,8 +150,8 @@ void testMain() {
150150 final EngineFlutterView view1 = createAndRegisterView (dispatcher);
151151 final EngineFlutterView view2 = createAndRegisterView (dispatcher);
152152
153- view1.dom.rootElement.focus ();
154- view2.dom.rootElement.focus ();
153+ view1.dom.rootElement.focusWithoutScroll ();
154+ view2.dom.rootElement.focusWithoutScroll ();
155155 view2.dom.rootElement.blur ();
156156
157157 expect (dispatchedViewFocusEvents, hasLength (3 ));
@@ -254,7 +254,7 @@ void testMain() {
254254 final EngineFlutterView view = createAndRegisterView (dispatcher);
255255
256256 view.dom.rootElement.append (input);
257- input.focus ();
257+ input.focusWithoutScroll ();
258258
259259 dispatcher.requestViewFocusChange (
260260 viewId: view.viewId,
0 commit comments