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

[Form controls] Better indicators for invalid state #2017

Closed
13 tasks done
cchaos opened this issue Jun 10, 2019 · 9 comments · Fixed by #6705
Closed
13 tasks done

[Form controls] Better indicators for invalid state #2017

cchaos opened this issue Jun 10, 2019 · 9 comments · Fixed by #6705
Assignees

Comments

@cchaos
Copy link
Contributor

cchaos commented Jun 10, 2019

At the moment, we just add a red underline. Let's consider adding an icon on the right side of the input as well. This is best for accessibility for those with color-blindness that find it hard to detect the difference between blue and red.

Also, we keep running into issues where the focused state (blue line) overrides the invalid state making it unclear that certain (mostly number) inputs are invalid as the user types.

Guidelines Example:

image


Components to update:

  • EuiFieldNumber
  • EuiFieldPassword
  • EuiFieldSearch
  • EuiFieldText
  • EuiFilePicker
  • EuiSelect
  • EuiSuperSelect
  • EuiTextarea
  • EuiComboBox
  • EuiDatePicker
  • EuiDatePickerRange
  • EuiSuperDatePicker
  • EuiRange/EuiDualRange
@myasonik
Copy link
Contributor

I definitely support adding more indicators to our forms about error states.

Currently, by only indicating errors through color, we fail to meet WCAG level A guidelines for accessibility guidelines (more at Use of Color guidelines).

@ryankeairns
Copy link
Contributor

For current accessibility needs, EUI does provide styles for adding error/help text which we highly recommend: https://elastic.github.io/eui/#/forms/form-validation

@myasonik
Copy link
Contributor

I think accessible by default (or, at least, closer to it) would be a good step forward. Leaving it up to the implementing developer as optionally accessible more often then not results in a lot of inaccessible usage.

But even with the error copy, the only thing that differentiates error copy and help copy is, again, color. So if you didn't notice the form changing color, noticing some new error copy is also probably pretty difficult.

Regardless of how the icon indicator shakes out, another options is requiring inline error copy (which could be improved to differentiate it better as well). This would also help with issues around long forms like in #1854.

@ryankeairns
Copy link
Contributor

@myasonik Thanks for the feedback. To be clear, I was not suggesting what we have is enough, just pointing out that we have other things which can mitigate the current situation.

@cchaos cchaos changed the title [Discuss] Use icons to indicate problems in the form, not just color [Form controls] Use icons to indicate problems in the form, not just color Sep 20, 2020
@cchaos
Copy link
Contributor Author

cchaos commented Sep 30, 2020

As an addition to this, we should be able to continue to indicate invalid states when in focus. Per @mbondyra's comment in another issue:

EuiRangeInput doesn’t show invalid state (eg. out of the range or defined in isInvalid prop) as long as I have focus, and the red highlighting would only appear once I blur the input. I tried to play with it by passing directly isInvalid prop with condition, but it doesn’t change anything (demo here, applying the value -1 would be the showcase).

image

@cchaos cchaos changed the title [Form controls] Use icons to indicate problems in the form, not just color [Form controls] Better indicators for invalid state Oct 2, 2020
@cchaos cchaos added the !urgent! label Oct 2, 2020
@cchaos cchaos self-assigned this Oct 6, 2020
@ryankeairns
Copy link
Contributor

FWIW, I just ran across this design on GitHub while creating labels:

Screen Shot 2020-10-08 at 10 54 49 AM

@github-actions
Copy link

github-actions bot commented Apr 6, 2021

👋 Hey there. This issue hasn't had any activity for 180 days. We'll automatically close it if that trend continues for another week. If you feel this issue is still valid and needs attention please let us know with a comment.

@cchaos
Copy link
Contributor Author

cchaos commented Apr 6, 2021

This is a forever, yes.

@cchaos
Copy link
Contributor Author

cchaos commented Mar 30, 2022

I've done most of the pre-work in #5738 and most of the simple controls. I'm removing myself as assignment and opening for anyone to tackle the other components.

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