Skip to content
This repository was archived by the owner on May 20, 2023. It is now read-only.

Commit b2cebcf

Browse files
Googlernshahan
authored andcommitted
call focus() should focus only when _autoFocus is true for autoFocus directive
Currently focus() works regardless of autoFocus state. PiperOrigin-RevId: 199233319
1 parent b336202 commit b2cebcf

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

lib/focus/focus.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,8 @@ class AutoFocusDirective extends RootFocusable implements OnInit, OnDestroy {
175175

176176
@override
177177
void focus() {
178+
if (!_autoFocus) return;
179+
178180
if (_focusable != null) {
179181
_focusable.focus();
180182
} else {

0 commit comments

Comments
 (0)