File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
packages/kit-styled/src/components/input Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -12,23 +12,25 @@ export const Input = component$<InputProps>(
12
12
'bind:value' : valueSig ,
13
13
// eslint-disable-next-line @typescript-eslint/no-unused-vars
14
14
'bind:checked' : checkedSig ,
15
+ id,
15
16
...props
16
17
} ) => {
18
+ const inputId = id || name ;
17
19
return (
18
20
< >
19
21
< input
20
22
{ ...props }
21
- aria-errormessage = { `${ name } -error` }
23
+ aria-errormessage = { `${ inputId } -error` }
22
24
aria-invalid = { ! ! error }
23
25
bind :value = { valueSig }
24
26
class = { cn (
25
27
'flex h-12 w-full rounded-base border border-input bg-background px-3 py-1 text-sm text-foreground shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50' ,
26
28
props . class ,
27
29
) }
28
- id = { name }
30
+ id = { inputId }
29
31
/>
30
32
{ error && (
31
- < div id = { `${ name } -error` } class = "text-destructive mt-1 text-sm" >
33
+ < div id = { `${ inputId } -error` } class = "text-destructive mt-1 text-sm" >
32
34
{ error }
33
35
</ div >
34
36
) }
You can’t perform that action at this time.
0 commit comments