Issue #2409885 by nlisgo, tstoeckler, crasx, dmsmidt: Switch shortcut set form has accessibility issues

8.0.x
Alex Pott 2015-04-21 00:32:19 +01:00
parent 1c3f898ed7
commit c83565f687
2 changed files with 5 additions and 1 deletions

View File

@ -100,6 +100,9 @@ class SwitchShortcutSet extends FormBase {
'visible' => array(
':input[name="set"]' => array('value' => 'new'),
),
'required' => array(
':input[name="set"]' => array('value' => 'new'),
),
),
);
$form['id'] = array(
@ -162,7 +165,7 @@ class SwitchShortcutSet extends FormBase {
if ($form_state->getValue('set') == 'new') {
// Check to prevent creating a shortcut set with an empty title.
if (trim($form_state->getValue('label')) == '') {
$form_state->setErrorByName('new', $this->t('The new set label is required.'));
$form_state->setErrorByName('label', $this->t('The new set label is required.'));
}
}
}

View File

@ -134,6 +134,7 @@ class ShortcutSetsTest extends ShortcutTestBase {
$this->assertText(t('The new set label is required.'));
$current_set = shortcut_current_displayed_set($this->adminUser);
$this->assertEqual($current_set->id(), $this->set->id(), 'Attempting to switch to a new shortcut set without providing a set name does not succeed.');
$this->assertFieldByXPath("//input[@name='label' and contains(concat(' ', normalize-space(@class), ' '), ' error ')]", NULL, 'The new set label field has the error class');
}
/**