-
Notifications
You must be signed in to change notification settings - Fork 841
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
[All EUI form controls] Browser validity messages should automatically populate EuiFormRow error
s
#6802
Comments
👋 Hi there - this issue hasn't had any activity in 6 months. If the EUI team has not explicitly expressed that this is something on our roadmap, it's unlikely that we'll pick this issue up. We would sincerely appreciate a PR/community contribution if this is something that matters to you! If not, and there is no further activity on this issue for another 6 months (i.e. it's stale for over a year), the issue will be auto-closed. |
👋 Hi there - this issue hasn't had any activity in 6 months. If the EUI team has not explicitly expressed that this is something on our roadmap, it's unlikely that we'll pick this issue up. We would sincerely appreciate a PR/community contribution if this is something that matters to you! If not, and there is no further activity on this issue for another 6 months (i.e. it's stale for over a year), the issue will be auto-closed. |
Another validation feature also possibly worth investigating at the same time: #7420 |
Original request: #6747
Problem
EuiFieldNumber
currently shows an icon when:invalid
as determined by browsers (e.g. belowmin
, abovemax
, outsidestep
, etc.) but does not offer any additional messaging aside from that. This is particularly problematic for browsers such as Safari which do not expose the validity message whatsoever, even in a mouseover tooltip. This is also problematic for screen reader users, who do not have access to the browser validity messages whatsoever.Solution
Desired end behavior (but a holistic approach/solution): https://codesandbox.io/s/hungry-cerf-m14fpn?file=/demo.js
Architecturally, we'll want to solve this at a DRYer level:
EuiFieldNumber
and instead make it reusable logic that lives withinEuiValidatableControl
min
andmax
length also apply to text inputs, other inputs can have native browserregex
s, e.g. email/password fieldsBrowserValidity
context that comes from a parent wrapping<EuiFormRow>
that allows children to pass back uperror
s to be displayed (e.g.setBrowserErrors
).error
s should be concatenated with any consumer-set errors (as opposed to overriding them) by default.showBrowserErrors
flag (that defaults to true, but can be turned off with false) that allows hiding browser errors entirely (in case consumers want to control/provide their own errors).onBrowserInvalid
callback to consumers as well for extra flexibility.EuiFormRow
, we may want to consider detecting that thesetBrowserErrors
API doesn't exist, and fall back to displaying a tooltip around the invalid icon.The text was updated successfully, but these errors were encountered: