-
Notifications
You must be signed in to change notification settings - Fork 843
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
[EuiFieldText] required
prop validating immediately, not on blur
#4710
Comments
Appears to just be a styling issue, resolved with .euiFieldText:not(:focus):invalid {
background-image: none;
}
.euiFieldText:not(:placeholder-shown):invalid {
background-image: linear-gradient(to top, #bd271e, #bd271e 2px, transparent 2px, transparent 100%);
} Essentially just replacing .euiFieldText:invalid {
background-image: linear-gradient(to top, #BD271E, #BD271E 2px, transparent 2px, transparent 100%);
background-size: 100%;
} with .euiFieldText:not(:placeholder-shown):invalid {
background-image: linear-gradient(to top, #BD271E, #BD271E 2px, transparent 2px, transparent 100%);
background-size: 100%;
} |
Yes, we intentionally override the invalid color with the focus color when the input is in focus. If validation only occurs Appreciate the feedback here, but not something we will be changing as it was a conscious decision. |
Apologies, the fork link was supposed to take you to a codepen. Ignore |
@cchaos Reading your comments back, I think there was a misunderstanding here and believe this issue should be reopened. To elaborate, if a field is |
Unfortunately that's just how browser's interpret And an explanation from MDN: https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/required#constraint_validation |
The
required
prop is violating the form usage guidelinesHere's a fork of the form validation sandbox
The text was updated successfully, but these errors were encountered: