Added keyboard event

This commit is contained in:
Patrick Alvin Alcala 2025-10-06 15:58:35 +08:00
parent 2aaf87b8d3
commit 3bbf9ccd8a

View file

@ -6,12 +6,13 @@ interface Props {
label?: string
value: string
onChange: Setter<string>
onKeyDown?: (event: KeyboardEvent) => void
}
export default (props: Props) => {
return (
<>
<TextField class="text-field" value={props.value} onChange={props.onChange}>
<TextField class="text-field" value={props.value} onChange={props.onChange} onKeyDown={props.onKeyDown}>
<Show when={props.label}>
<TextField.Label class="text-field__label">{props.label}</TextField.Label>
</Show>