Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Connection with issue(s)
Close #955
Close #1049
Connected to flutter-form-builder-ecosystem/form_builder_extra_fields#10
Solution description
BREAKING CHANGE
This PR improve how handle and use focus and scroll when validate and invalidate fields.
Now, we have two news behaviors when validate or invalidate a field or form:
autoScrollWhenFocusOnInvalid
will be true, automatic scroll will happens and will show the first or single error. By default, this behavior is deactivateNote: If a invalid field is from type TextField and will focused, the form will auto scroll to show this invalid field.
In this case, the automatic scroll happens because is a behavior inside the framework, not because
autoScrollWhenFocusOnInvalid
is true.shouldRequestFocus
for each form fieldautoFocusOnValidationFailure
on FormBuilderfocusOnInvalid
andautoScrollWhenFocusOnInvalid
tovalidate
andsaveAndValidate
methods fromFormBuilderState
focusOnInvalid
andautoScrollWhenFocusOnInvalid
tovalidate
method fromFormBuilderFieldState
shouldFocus
andshouldAutoScrollWhenFocus
toinvalidate
method fromFormBuilderFieldState
In other hand, remove and add some deprecated fields and update example config.
To Do