Closed joshuagraber closed 5 days ago
@joshuagraber When I go to test, using the same password in each field, I still get an error.
In the console, I'm getting a message about cookies...relevant? edit: the message appears on page load, not form submit
Hmm, @josh-chamberlain could you share more steps to reproduce? If both inputs contain a matching, valid (per validation currently on data-sources
) password, it should clear automatically.
Not sure about the cookies, but we're not reading anything cross-site, so it must be something about the dev env. (Edit: or maybe browser extensions. Those can sometimes cause console errors/warnings as well.)
(We do want to handle that autocomplete
warning though, so I'll do that next week after I'm back.)
sorry about the delay @joshuagraber !
I get the same behavior whether I use the same password or different passwords.
@josh-chamberlain No worries. Those are input-level errors, which means these are not valid passwords. The messages aren't super informative (we'll craft better ones for v2), but on this demo it's just dummy validation.
A valid password requires: 8 characters, of which: 1 Capital letter 1 lowercase letter 1 number 1 special character
I've just been using Password1!
What we're testing here is the form-level errors passed while the calling component validates any extra requirements that we can't handle with our schemas (yet, although that's not a bad idea...) on submission, i.e. that the passwords match. So no input-level errors should be there at all. Otherwise, the form is prevented from submitting.
Please consider investigating the findings and remediating the incidents. Failure to do so may lead to compromising the associated services or software components.
🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.
:tada: This PR is included in version 3.0.0-beta.2 :tada:
The release is available on:
Your semantic-release bot :package::rocket:
Background
See #58
Sometimes we will want to do custom validation on form submission. (See the login / signin form in
data-sources
). When this happens, the UX will be better if we preserve the current input values for the user, rather than clearing them on every form submission automatically.Description
resetOn
toForm
of type'submit' | boolean
. If'submit'
is passed, the form clears on submission. Ifboolean
is passed, the form only resets when theresetOn
prop changes totrue
.Form
testsTo test
localhost:8888/sign-up-demo
Password1!
andPassword2!