Skip to content

Commit

Permalink
Replace react’s autoFocus prop → HTML autofocus
Browse files Browse the repository at this point in the history
the autofocus attribute includes the correct behavior for focusable elements that live inside dialogues or popovers on show, while the react autoFocus prop only causes an element to be focused on mount
  • Loading branch information
acusti committed Feb 11, 2024
1 parent 5b46b91 commit b20dbea
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/input-text/src/InputText.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ export default React.forwardRef<HTMLInputElement, Props>(function InputText(
<Element
autoCapitalize={autoCapitalize}
autoComplete={autoComplete}
autoFocus={autoFocus} // eslint-disable-line jsx-a11y/no-autofocus
autofocus={autoFocus}

Check failure on line 229 in packages/input-text/src/InputText.tsx

View workflow job for this annotation

GitHub Actions / build (18.x)

Type '{ onInput: () => void; rows: number; autoCapitalize: "none" | "off" | "sentences" | "words" | "characters" | undefined; autoComplete: AutoFill | undefined; autofocus: boolean | undefined; ... 26 more ...; type: "number" | ... 5 more ... | "url"; } | { ...; }' is not assignable to type 'IntrinsicAttributes & ClassAttributes<HTMLInputElement> & InputHTMLAttributes<HTMLInputElement>'.

Check failure on line 229 in packages/input-text/src/InputText.tsx

View workflow job for this annotation

GitHub Actions / build (20.x)

Type '{ onInput: () => void; rows: number; autoCapitalize: "none" | "off" | "sentences" | "words" | "characters" | undefined; autoComplete: AutoFill | undefined; autofocus: boolean | undefined; ... 26 more ...; type: "number" | ... 5 more ... | "url"; } | { ...; }' is not assignable to type 'IntrinsicAttributes & ClassAttributes<HTMLInputElement> & InputHTMLAttributes<HTMLInputElement>'.
className={className}
defaultValue={initialValue ?? ''}
disabled={disabled}
Expand Down

0 comments on commit b20dbea

Please sign in to comment.