mirror of
https://github.com/mattermost/mattermost.git
synced 2025-02-25 18:55:24 -06:00
[MM 22957] webapp a11y: fix sso btns focus issue (#23326)
* make suggested changes * added form tag and removed event handler * fix snapshot --------- Co-authored-by: Mattermost Build <build@mattermost.com>
This commit is contained in:
parent
305fac6507
commit
0ccd82c1d4
@ -57,7 +57,6 @@ exports[`components/login/Login should match snapshot with base login 1`] = `
|
|||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
className="login-body-card-content"
|
className="login-body-card-content"
|
||||||
onKeyDown={[Function]}
|
|
||||||
tabIndex={0}
|
tabIndex={0}
|
||||||
>
|
>
|
||||||
<p
|
<p
|
||||||
@ -65,6 +64,9 @@ exports[`components/login/Login should match snapshot with base login 1`] = `
|
|||||||
>
|
>
|
||||||
Log in
|
Log in
|
||||||
</p>
|
</p>
|
||||||
|
<form
|
||||||
|
onSubmit={[Function]}
|
||||||
|
>
|
||||||
<div
|
<div
|
||||||
className="login-body-card-form"
|
className="login-body-card-form"
|
||||||
>
|
>
|
||||||
@ -107,6 +109,7 @@ exports[`components/login/Login should match snapshot with base login 1`] = `
|
|||||||
savingMessage="Logging in…"
|
savingMessage="Logging in…"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
</form>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
||||||
// See LICENSE.txt for license information.
|
// See LICENSE.txt for license information.
|
||||||
|
|
||||||
import React, {useState, useEffect, useRef, useCallback} from 'react';
|
import React, {useState, useEffect, useRef, useCallback, FormEvent} from 'react';
|
||||||
import {useIntl} from 'react-intl';
|
import {useIntl} from 'react-intl';
|
||||||
import {Link, useLocation, useHistory} from 'react-router-dom';
|
import {Link, useLocation, useHistory} from 'react-router-dom';
|
||||||
import {useSelector, useDispatch} from 'react-redux';
|
import {useSelector, useDispatch} from 'react-redux';
|
||||||
@ -672,12 +672,6 @@ const Login = ({onCustomizeHeader}: LoginProps) => {
|
|||||||
setBrandImageError(true);
|
setBrandImageError(true);
|
||||||
};
|
};
|
||||||
|
|
||||||
const onEnterKeyDown = (e: React.KeyboardEvent<HTMLInputElement>) => {
|
|
||||||
if (e.key === Constants.KeyCodes.ENTER[0]) {
|
|
||||||
preSubmit(e);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
const getCardTitle = () => {
|
const getCardTitle = () => {
|
||||||
if (CustomDescriptionText) {
|
if (CustomDescriptionText) {
|
||||||
return CustomDescriptionText;
|
return CustomDescriptionText;
|
||||||
@ -765,7 +759,6 @@ const Login = ({onCustomizeHeader}: LoginProps) => {
|
|||||||
<div className={classNames('login-body-card', {'custom-branding': enableCustomBrand, 'with-error': hasError})}>
|
<div className={classNames('login-body-card', {'custom-branding': enableCustomBrand, 'with-error': hasError})}>
|
||||||
<div
|
<div
|
||||||
className='login-body-card-content'
|
className='login-body-card-content'
|
||||||
onKeyDown={onEnterKeyDown}
|
|
||||||
tabIndex={0}
|
tabIndex={0}
|
||||||
>
|
>
|
||||||
<p className='login-body-card-title'>
|
<p className='login-body-card-title'>
|
||||||
@ -781,6 +774,11 @@ const Login = ({onCustomizeHeader}: LoginProps) => {
|
|||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
{enableBaseLogin && (
|
{enableBaseLogin && (
|
||||||
|
<form
|
||||||
|
onSubmit={(event: FormEvent<HTMLFormElement>) => {
|
||||||
|
preSubmit(event as unknown as React.MouseEvent);
|
||||||
|
}}
|
||||||
|
>
|
||||||
<div className='login-body-card-form'>
|
<div className='login-body-card-form'>
|
||||||
<Input
|
<Input
|
||||||
ref={loginIdInput}
|
ref={loginIdInput}
|
||||||
@ -819,6 +817,7 @@ const Login = ({onCustomizeHeader}: LoginProps) => {
|
|||||||
savingMessage={formatMessage({id: 'login.logingIn', defaultMessage: 'Logging in…'})}
|
savingMessage={formatMessage({id: 'login.logingIn', defaultMessage: 'Logging in…'})}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
</form>
|
||||||
)}
|
)}
|
||||||
{enableBaseLogin && enableExternalSignup && (
|
{enableBaseLogin && enableExternalSignup && (
|
||||||
<div className='login-body-card-form-divider'>
|
<div className='login-body-card-form-divider'>
|
||||||
|
Loading…
Reference in New Issue
Block a user