Turn off/remove disables for jsx-a11y/no-autofocus

This commit is contained in:
tidy-dev 2023-05-16 13:11:07 -04:00
parent 09ef4f6f1b
commit 5ddaea898d
12 changed files with 15 additions and 11 deletions

View file

@ -186,6 +186,21 @@ rules:
- selector: ExportDefaultDeclaration
message: Use of default exports is forbidden
###########
# jsx-a11y #
###########
# autofocus is fine when it is being used to set focus to something in a way
# that doesn't skip any context or inputs. For example, in a named dialog, if you had
# a close button, a heading reflecting the name, and a labelled text input,
# focusing the text input wouldn't disadvantage a user because they're not
# missing anything of importance before it. The problem is when it is used on
# larger web pages, e.g. to focus a form field in the main content, entirely
# skipping the header and often much else besides.
jsx-a11y/no-autofocus:
- warn
- ignoreNonDOM: true
overrides:
- files: '*.d.ts'
rules:

View file

@ -37,7 +37,6 @@ export class CloneGenericRepository extends React.Component<
placeholder="URL or username/repository"
value={this.props.url}
onValueChanged={this.onUrlChanged}
// eslint-disable-next-line jsx-a11y/no-autofocus
autoFocus={true}
label={
<span>

View file

@ -34,7 +34,6 @@ export class DiffSearchInput extends React.Component<
<TextBox
placeholder="Search..."
type="search"
// eslint-disable-next-line jsx-a11y/no-autofocus
autoFocus={true}
onValueChanged={this.onChange}
onKeyDown={this.onKeyDown}

View file

@ -61,7 +61,6 @@ export class GenericGitAuthentication extends React.Component<
<Row>
<TextBox
label="Username"
// eslint-disable-next-line jsx-a11y/no-autofocus
autoFocus={true}
value={this.state.username}
onValueChanged={this.onUsernameChange}

View file

@ -107,7 +107,6 @@ export class AuthenticationForm extends React.Component<
disabled={disabled}
required={true}
displayInvalidState={false}
// eslint-disable-next-line jsx-a11y/no-autofocus
autoFocus={true}
onValueChanged={this.onUsernameChange}
/>

View file

@ -55,7 +55,6 @@ export class EnterpriseServerEntry extends React.Component<
<Form onSubmit={this.onSubmit}>
<TextBox
label="Enterprise or AE address"
// eslint-disable-next-line jsx-a11y/no-autofocus
autoFocus={true}
disabled={disableEntry}
onValueChanged={this.onServerAddressChanged}

View file

@ -41,7 +41,6 @@ export class FancyTextBox extends React.Component<
value={this.props.value}
onFocus={this.onFocus}
onBlur={this.onBlur}
// eslint-disable-next-line jsx-a11y/no-autofocus
autoFocus={this.props.autoFocus}
disabled={this.props.disabled}
type={this.props.type}

View file

@ -250,7 +250,6 @@ export class FilterList<T extends IFilterListItem> extends React.Component<
<TextBox
ref={this.onTextBoxRef}
type="search"
// eslint-disable-next-line jsx-a11y/no-autofocus
autoFocus={true}
placeholder={this.props.placeholderText || 'Filter'}
className="filter-list-filter-field"

View file

@ -74,7 +74,6 @@ export class TextArea extends React.Component<ITextAreaProps, {}> {
{this.props.label}
<textarea
// eslint-disable-next-line jsx-a11y/no-autofocus
autoFocus={this.props.autoFocus}
className={this.props.textareaClassName}
disabled={this.props.disabled}

View file

@ -262,7 +262,6 @@ export class TextBox extends React.Component<ITextBoxProps, ITextBoxState> {
ref={this.onInputRef}
onFocus={this.onFocus}
onBlur={this.onBlur}
// eslint-disable-next-line jsx-a11y/no-autofocus
autoFocus={this.props.autoFocus}
disabled={this.props.disabled}
type={this.props.type}

View file

@ -78,7 +78,6 @@ export class TwoFactorAuthentication extends React.Component<
<TextBox
label="Authentication code"
disabled={textEntryDisabled}
// eslint-disable-next-line jsx-a11y/no-autofocus
autoFocus={true}
onValueChanged={this.onOTPChange}
/>

View file

@ -1,4 +1,3 @@
/* eslint-disable jsx-a11y/no-autofocus */
import * as React from 'react'
import { Dispatcher } from '../dispatcher'
import {