Skip to content

[Form controls] Better indicators for invalid state #2017

Closed

Description

@cchaos

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

Activity

  1. added
    design decision
    on Jun 10, 2019
  2. myasonik commented on Jun 25, 2019

    @myasonik
    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).

  3. ryankeairns commented on Jun 26, 2019

    @ryankeairns
    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

  4. myasonik commented on Jun 26, 2019

    @myasonik
    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.

  5. ryankeairns commented on Jun 26, 2019

    @ryankeairns
    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.

  6. 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[/+] on Sep 20, 2020
  7. cchaos commented on Sep 30, 2020

    @cchaos
    ContributorAuthor

    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

  8. changed the title [-][Form controls] Use icons to indicate problems in the form, not just color[/-] [+][Form controls] Better indicators for invalid state[/+] on Oct 2, 2020
  9. self-assigned this
    on Oct 6, 2020
  10. ryankeairns commented on Oct 8, 2020

    @ryankeairns
    Contributor

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

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

  11. github-actions commented on Apr 6, 2021

    @github-actions

    👋 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.

  12. added
    stale-issue
    on Apr 6, 2021
  13. cchaos commented on Apr 6, 2021

    @cchaos
    ContributorAuthor

    This is a forever, yes.

  14. added and removed
    stale-issue
    on Apr 6, 2021
  15. removed their assignment
    on Mar 30, 2022
  16. cchaos commented on Mar 30, 2022

    @cchaos
    ContributorAuthor

    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.

  17. added and removed
    design decision
    on Mar 30, 2022
  18. self-assigned this
    on Apr 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions