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

pull/56293/head
Ashley Harrison 3 years ago committed by GitHub
parent 80dfa788c6
commit e942a3d99d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 7
      .eslintrc
  2. 2
      packages/grafana-ui/src/components/Segment/SegmentInput.tsx
  3. 1
      public/app/features/search/components/DashboardSearch.tsx
  4. 1
      public/app/features/search/components/DashboardSearchModal.tsx

@ -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": [

@ -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}

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

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

Loading…
Cancel
Save