Skip to content

Commit

Permalink
Merge pull request #193 from ec-europa/NEPT-2755
Browse files Browse the repository at this point in the history
NEPT-2755: Fix textarea error highlight
  • Loading branch information
Fefaine authored Feb 6, 2020
2 parents 63a2de4 + 2b84bf7 commit e957bb4
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
4 changes: 3 additions & 1 deletion templates/textarea/textarea.component.inc
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@ function ec_europa_atomium_definition_form_textarea(array $form, array &$form_st
* Implements hook_preprocess_hook().
*/
function ec_europa_preprocess_textarea(array &$variables, $hook) {
$variables['atomium']['attributes']['element']->merge($variables['element']['#attributes']);
$classes = array('ecl-textarea');
$error_classes = array('ecl-textarea--has-error');
_ec_europa_form_set_css_class($variables, $classes, $error_classes);
$variables['atomium']['attributes']['element']->append('class', 'ecl-textarea');
$variables['atomium']['attributes']['element']->setAttribute('role', 'textbox');
$variables['atomium']['attributes']['element']->setAttribute('aria-multiline', 'true');
Expand Down
8 changes: 8 additions & 0 deletions templates/textarea/textarea.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,11 @@
margin: 0;
text-decoration: underline;
}
.ecl-textarea:focus {
border-color: #fbc11d;
outline: 3px solid #fbc11d;
}
.ecl-textarea--has-error {
border-color: #da2130;
border-width: 2px;
}

0 comments on commit e957bb4

Please sign in to comment.