Repository navigation
Move form submission callbacks to submit and improve form samples - #3
Merged
Merged
Conversation
There was a problem hiding this comment.
This change moves submission callbacks to submit, renames the error-reporting flag, and updates documentation and samples with multiline notes and counters. No blocking issues found. The callback routing, state-saving format, reactive-validation behavior, migrated tests, and sample value flow are consistent with the documented breaking API. Supplied CI reports successful build/test and analysis checks; I did not independently run Gradle tests or verify Android/iOS UI behavior.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Supply the success callback at
submitinstead of storing it onForm. Preserve the existing reactive validation behavior: errors are tracked as inputs change, and submit enables reporting before checking the latest stored errors.Breaking API for the next release:
onSubmitfromFormand pass success tosubmit(onInvalid = { ... }) { ... }. Oldsubmit { ... }trailing lambdas handled invalid input; move those handlers to the namedonInvalidargument.shouldShowErrorstoisErrorReportingEnabledin constructors, saveable state helpers and property access. This controls error reporting and form validity; validation runs regardless of the flag.Both submit callbacks receive
FormScope, allowing reusable invalid handlers to inspect fields and errors.ValidationEffect.validatorsnow defaults to an empty list, matchingFormField.The existing signup sample demonstrates reusable multiline input with a visible length counter and includes notes in its submitted summary. A short README snippet shows server-error assignment through the existing field API; no backend response simulation or request policy is added. README and KDoc explain the existing reactive-validation boundary and include migration examples.
No validation registry or synchronous submit-time validation is added. Existing CI/CD, Gradle configuration and test cases are preserved; test call sites are migrated to the new signatures. No additional tests or publication-verification infrastructure remain.
Validation: the existing 31 library tests and 1 sample test passed on Android JVM, with no failures or skips. Existing tests exercise a reusable scoped invalid handler and omitted validators. The reactive validation and reporting behavior is preserved.
This PR remains a draft; no version or release-signing changes are included.