Skip to content
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

Merged
merged 3 commits into from
May 15, 2023
Merged

Add support for reset button #134

merged 3 commits into from
May 15, 2023

Conversation

simonihmig
Copy link
Contributor

@simonihmig simonihmig commented May 15, 2023

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!

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-bot
Copy link

changeset-bot bot commented May 15, 2023

🦋 Changeset detected

Latest commit: aeaeca5

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
ember-headless-form Patch
docs-app Patch

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

@github-actions
Copy link
Contributor

github-actions bot commented May 15, 2023

Preview URLs

Env: preview
Docs: https://e1a0de0f.ember-headless-form.pages.dev

Copy link
Contributor

@ynotdraw ynotdraw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent!

.doesNotExist('validation errors are removed on reset');
assert.dom('[data-test-first-name]').doesNotHaveAria('invalid');
assert.dom('[data-test-invalid]').doesNotExist();
});
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test is great! 🎉

Base automatically changed from data-updates to main May 15, 2023 12:42
Co-authored-by: Tony Ward <[email protected]>
@simonihmig simonihmig merged commit b3af3d9 into main May 15, 2023
@simonihmig simonihmig deleted the reset branch May 15, 2023 12:51
@github-actions github-actions bot mentioned this pull request May 15, 2023
delete this.internalData[key as keyof DATA];
}

this.validationState = undefined;
Copy link
Contributor

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support <input type='reset'>
3 participants