Skip to content

Commit

Permalink
fix(textinput): onKeyUp/Down not forwarded
Browse files Browse the repository at this point in the history
  • Loading branch information
vincentaudebert committed Oct 23, 2024
1 parent 842279d commit cb502ee
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/form/src/components/TextInputFieldV2/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ export const TextInputField = <
role,
'aria-live': ariaLive,
'aria-atomic': ariaAtomic,
onKeyDown,
onKeyUp,
}: TextInputFieldProps<TFieldValues, TFieldName>) => {
const { getError } = useErrors()

Expand Down Expand Up @@ -142,6 +144,8 @@ export const TextInputField = <
role={role}
aria-live={ariaLive}
aria-atomic={ariaAtomic}
onKeyDown={onKeyDown}
onKeyUp={onKeyUp}
/>
)
}
3 changes: 3 additions & 0 deletions packages/ui/src/components/TextInputV2/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ type TextInputProps = {
| 'tabIndex'
| 'autoComplete'
| 'onKeyDown'
| 'onKeyUp'
| 'role'
| 'aria-live'
| 'aria-atomic'
Expand Down Expand Up @@ -227,6 +228,7 @@ export const TextInputV2 = forwardRef<HTMLInputElement, TextInputProps>(
'aria-label': ariaLabel,
autoComplete,
onKeyDown,
onKeyUp,
role,
'aria-live': ariaLive,
'aria-atomic': ariaAtomic,
Expand Down Expand Up @@ -354,6 +356,7 @@ export const TextInputV2 = forwardRef<HTMLInputElement, TextInputProps>(
autoComplete={autoComplete}
required={required}
onKeyDown={onKeyDown}
onKeyUp={onKeyUp}
/>
{success || error || loading || computedClearable ? (
<StateStack direction="row" gap={1} alignItems="center">
Expand Down

0 comments on commit cb502ee

Please sign in to comment.