yahoo/jafar

Add classes to the default FieldView

Offen

#36 geöffnet am 23.02.2020

 (0 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)JavaScript (9 Forks)auto 404
enhancementgood first issuehelp wantedquestion

Repository-Metriken

Stars
 (109 Sterne)
PR-Merge-Metriken
 (Keine gemergten PRs in 30 T)

Beschreibung

We should add classes to the default FieldView (in react-form) to indicate fields statues.

Question to figure before implementing: should we use aria- instead? And is all the alternative aria-* relevant for non input elements such a container div? is there a better way to describe this on the DOM?

To the root div of the field

  • jafar-field (always exists)
  • jafar-required (only if required=true)
  • jafar-empty (only if empty=true)
  • jafar-disabled (only if disabled=true)
  • jafar-invalid (only if invalid=true)
  • jafar-dirty (only if dirty=true)

To the div that wraps the component

  • jafar-component

To the div that wraps the error

  • jafar-error

To the header

  • jafar-header

To the div that wraps the label

  • jafar-label

To the div that wraps the description

  • jafar-description

To the div that wraps the asterisk of the required

  • jafar-required-indicator

Contributor Guide