diff --git a/packages/firebase_ui_auth/lib/src/widgets/phone_input.dart b/packages/firebase_ui_auth/lib/src/widgets/phone_input.dart index 1b39457c..3f5ff11b 100644 --- a/packages/firebase_ui_auth/lib/src/widgets/phone_input.dart +++ b/packages/firebase_ui_auth/lib/src/widgets/phone_input.dart @@ -91,6 +91,9 @@ class PhoneInput extends StatefulWidget { /// picker. final String? initialCountryCode; + /// Whether the phone input text field should be focused as soon as it's visible. + final bool autoFocus; + /// Returns a phone number from the [PhoneInput] that was provided a [key]. static String? getPhoneNumber(GlobalKey key) { final state = key.currentState!; @@ -106,6 +109,7 @@ class PhoneInput extends StatefulWidget { const PhoneInput({ super.key, this.initialCountryCode, + this.autoFocus = true, this.onSubmit, }); @@ -318,7 +322,7 @@ class PhoneInputState extends State { autofillHints: const [ AutofillHints.telephoneNumberNational ], - autofocus: true, + autofocus: widget.autoFocus, focusNode: numberFocusNode, controller: numberController, placeholder: l.phoneInputLabel,