Skip to content

Commit

Permalink
fix(textinput): onKeyUp/Down not forwarded (#4385)
Browse files Browse the repository at this point in the history
* fix(textinput): onKeyUp/Down not forwarded

* fix: changeset

* Update .changeset/gorgeous-plants-reflect.md

Co-authored-by: Matthias Prost <[email protected]>

---------

Co-authored-by: Matthias Prost <[email protected]>
  • Loading branch information
vincentaudebert and matthprost authored Oct 28, 2024
1 parent 0a99da7 commit d203ee4
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .changeset/gorgeous-plants-reflect.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@ultraviolet/form": patch
"@ultraviolet/ui": patch
---

Fix <TextInputV2 /> onKeyUp/Down not forwarded
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 d203ee4

Please sign in to comment.