Skip to content

Commit d203ee4

Browse files
fix(textinput): onKeyUp/Down not forwarded (#4385)
* 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]>
1 parent 0a99da7 commit d203ee4

File tree

3 files changed

+13
-0
lines changed

3 files changed

+13
-0
lines changed

.changeset/gorgeous-plants-reflect.md

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"@ultraviolet/form": patch
3+
"@ultraviolet/ui": patch
4+
---
5+
6+
Fix <TextInputV2 /> onKeyUp/Down not forwarded

packages/form/src/components/TextInputFieldV2/index.tsx

+4
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@ export const TextInputField = <
6161
role,
6262
'aria-live': ariaLive,
6363
'aria-atomic': ariaAtomic,
64+
onKeyDown,
65+
onKeyUp,
6466
}: TextInputFieldProps<TFieldValues, TFieldName>) => {
6567
const { getError } = useErrors()
6668

@@ -142,6 +144,8 @@ export const TextInputField = <
142144
role={role}
143145
aria-live={ariaLive}
144146
aria-atomic={ariaAtomic}
147+
onKeyDown={onKeyDown}
148+
onKeyUp={onKeyUp}
145149
/>
146150
)
147151
}

packages/ui/src/components/TextInputV2/index.tsx

+3
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,7 @@ type TextInputProps = {
179179
| 'tabIndex'
180180
| 'autoComplete'
181181
| 'onKeyDown'
182+
| 'onKeyUp'
182183
| 'role'
183184
| 'aria-live'
184185
| 'aria-atomic'
@@ -227,6 +228,7 @@ export const TextInputV2 = forwardRef<HTMLInputElement, TextInputProps>(
227228
'aria-label': ariaLabel,
228229
autoComplete,
229230
onKeyDown,
231+
onKeyUp,
230232
role,
231233
'aria-live': ariaLive,
232234
'aria-atomic': ariaAtomic,
@@ -354,6 +356,7 @@ export const TextInputV2 = forwardRef<HTMLInputElement, TextInputProps>(
354356
autoComplete={autoComplete}
355357
required={required}
356358
onKeyDown={onKeyDown}
359+
onKeyUp={onKeyUp}
357360
/>
358361
{success || error || loading || computedClearable ? (
359362
<StateStack direction="row" gap={1} alignItems="center">

0 commit comments

Comments
 (0)