Skip to content

Commit

Permalink
Merge branch 'main' into fix-1230-improve-focus-validation
Browse files Browse the repository at this point in the history
  • Loading branch information
deandreamatias authored May 18, 2023
2 parents 7019dcc + 5dbe5b5 commit 8cfd21a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/src/form_builder_field.dart
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ class FormBuilderFieldState<F extends FormBuilderField<T>, T>

/// Invalidate field with a [errorText]
///
/// Focus field if [shoudlFocus] is `true`.
/// Focus field if [shouldFocus] is `true`.
/// By default `true`
///
/// Auto scroll when focus invalid if [shouldAutoScrollWhenFocus] is `true`.
Expand All @@ -268,15 +268,15 @@ class FormBuilderFieldState<F extends FormBuilderField<T>, T>
/// not because [shouldAutoScrollWhenFocus] is `true`.
void invalidate(
String errorText, {
bool shoudlFocus = true,
bool shouldFocus = true,
bool shouldAutoScrollWhenFocus = false,
}) {
setState(() => _customErrorText = errorText);

validate(
clearCustomError: false,
autoScrollWhenFocusOnInvalid: shouldAutoScrollWhenFocus,
focusOnInvalid: shoudlFocus,
focusOnInvalid: shouldFocus,
);
}

Expand Down

0 comments on commit 8cfd21a

Please sign in to comment.