Skip to content

Commit

Permalink
Port over addition of hidden "Error: " to error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
Jan Mikolajczak committed Mar 15, 2019
1 parent 913d8ef commit 7728af2
Showing 1 changed file with 4 additions and 0 deletions.
Expand Up @@ -2,4 +2,8 @@
/ https://github.com/alphagov/govuk-frontend/
/ blob/943ff14752f0a8a765ee3f90bc3e1ecd9205e36c/src/components/error-message/template.njk
span.govuk-error-message *(local_assigns[:attributes] || {}) id=local_assigns[:id] class=local_assigns[:classes]
/ Not using `.presence` or `||` here as we want to treat "" and nil differently.
- visually_hidden_text = local_assigns[:visuallyHiddenText].nil? ? "Error" : local_assigns[:visuallyHiddenText]
- if visually_hidden_text.present?
span.govuk-visually-hidden = "#{visually_hidden_text}: "
= local_assigns[:html] || local_assigns[:text]

0 comments on commit 7728af2

Please sign in to comment.