enable jsx-a11y/no-autofocus (#56288)

This commit is contained in:
Ashley Harrison 2022-10-04 12:54:14 +01:00 committed by GitHub
parent 80dfa788c6
commit e942a3d99d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 8 additions and 3 deletions

View File

@ -101,7 +101,12 @@
"jsx-a11y/media-has-caption": "error",
"jsx-a11y/mouse-events-have-key-events": "off",
"jsx-a11y/no-access-key": "error",
"jsx-a11y/no-autofocus": "off",
"jsx-a11y/no-autofocus": [
"error",
{
"ignoreNonDOM": true
}
],
"jsx-a11y/no-distracting-elements": "error",
"jsx-a11y/no-interactive-element-to-noninteractive-role": "error",
"jsx-a11y/no-noninteractive-element-interactions": [

View File

@ -74,6 +74,8 @@ export function SegmentInput<T>({
<input
{...rest}
ref={ref}
// this needs to autofocus, but it's ok as it's only rendered by choice
// eslint-disable-next-line jsx-a11y/no-autofocus
autoFocus
className={cx(`gf-form gf-form-input`, inputWidthStyle)}
value={value}

View File

@ -41,7 +41,6 @@ export function DashboardSearch({}: Props) {
onKeyDown={onKeyDown}
spellCheck={false}
className={styles.input}
autoFocus
/>
</div>

View File

@ -70,7 +70,6 @@ export function DashboardSearchModal({ isOpen }: Props) {
tabIndex={0}
spellCheck={false}
className={styles.input}
autoFocus
/>
</div>