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

Reset deletes elements #53

Open
brennaveen opened this issue Nov 15, 2020 · 0 comments
Open

Reset deletes elements #53

brennaveen opened this issue Nov 15, 2020 · 0 comments

Comments

@brennaveen
Copy link

The reset function (as well as the destroy function since it calls reset) actually deletes the elements from the dom. I do not believe this should be the intended behavior of a reset. I would expect it to simply remove the error and success statuses and reset the pristine instance to the state it was at before the form was validated. Am I thinking about this incorrectly?

This is the bit of code that removes the elements

Array.from(self.form.querySelectorAll('.' + PRISTINE_ERROR)).map(function (elem) {
    elem.parentNode.removeChild(elem);
});
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

No branches or pull requests

1 participant