Describe the bug
When an invalid password is entered in the login form, the password field does not automatically receive focus.
To Reproduce
Attempt to log in to Icinga Web with an invalid password.
Expected behavior
Since LoginForm conditionally adds the .autofocus CSS class during element creation, I would expect the password field to receive focus automatically when an invalid password is provided. Inspecting the element in dev tools confirms the CSS class is applied correctly, but the field does not receive focus.
LoginForm::createElements():
$this->addElement(
'text',
'username',
array(
// ...
'class' => false === isset($formData['username']) ? 'autofocus' : '',
// ...
)
);
$this->addElement(
'password',
'password',
array(
// ...
'class' => isset($formData['username']) ? 'autofocus' : ''
)
);
Additional context
When the login form is first opened, the username field correctly receives the .autofocus class and focus works as expected.
Describe the bug
When an invalid password is entered in the login form, the password field does not automatically receive focus.
To Reproduce
Attempt to log in to Icinga Web with an invalid password.
Expected behavior
Since
LoginFormconditionally adds the.autofocusCSS class during element creation, I would expect the password field to receive focus automatically when an invalid password is provided. Inspecting the element in dev tools confirms the CSS class is applied correctly, but the field does not receive focus.LoginForm::createElements():
Additional context
When the login form is first opened, the username field correctly receives the
.autofocusclass and focus works as expected.