-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for reset
button
#134
Conversation
Part of #117, this adds support for resetting the state of the form using a native reset button. Yielding a `reset` action will come in a separate PR.
🦋 Changeset detectedLatest commit: aeaeca5 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Preview URLsEnv: preview |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Excellent!
test-app/tests/integration/components/headless-form-reset-test.gts
Outdated
Show resolved
Hide resolved
.doesNotExist('validation errors are removed on reset'); | ||
assert.dom('[data-test-first-name]').doesNotHaveAria('invalid'); | ||
assert.dom('[data-test-invalid]').doesNotExist(); | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test is great! 🎉
Co-authored-by: Tony Ward <[email protected]>
delete this.internalData[key as keyof DATA]; | ||
} | ||
|
||
this.validationState = undefined; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Late to this, but: are we going to have explicit states for pristine/dirty
or the consumer can figure this out from the validationState
and the submissionState
?
Part of #117, closes #122, this adds support for resetting the state of the form using a native reset button. Yielding a
reset
action will come in a separate PR.Merge #132 first!