File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed
Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change 1- import { type ComponentProps , splitProps } from "solid-js"
1+ import { type ComponentProps , type JSX , splitProps } from "solid-js"
22import { Input } from "~ui/input/input/Input"
33import type { SignalObject } from "~ui/utils/createSignalObject"
44
@@ -7,6 +7,12 @@ export interface InputSProps extends ComponentProps<"input"> {
77}
88
99export function InputS ( p : InputSProps ) {
10- const [ , rest ] = splitProps ( p , [ "valueSignal" ] )
11- return < Input value = { p . valueSignal . get ( ) } onInput = { ( e ) => p . valueSignal . set ( e . currentTarget . value ) } { ...rest } />
10+ const [ , rest ] = splitProps ( p , [ "valueSignal" , "onInput" ] )
11+ const onInputLocal : JSX . InputEventHandlerUnion < HTMLInputElement , InputEvent > = ( e ) => {
12+ p . valueSignal . set ( e . currentTarget . value )
13+ if ( p . onInput && typeof p . onInput === "function" ) {
14+ p . onInput ( e )
15+ }
16+ }
17+ return < Input value = { p . valueSignal . get ( ) } onInput = { onInputLocal } { ...rest } />
1218}
You can’t perform that action at this time.
0 commit comments