Skip to content

Commit 43e3ae7

Browse files
fix: allow people to add initial values
1 parent fc86582 commit 43e3ae7

File tree

2 files changed

+3
-2
lines changed
  • apps/website/src/routes/docs/styled/input/examples
  • packages/kit-styled/src/components/input

2 files changed

+3
-2
lines changed

apps/website/src/routes/docs/styled/input/examples/hero.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { Input } from '~/components/ui';
44
export default component$(() => {
55
return (
66
<>
7-
<Input type="email" placeholder="Email" />
7+
<Input type="email" placeholder="Email" value="[email protected]" />
88
</>
99
);
1010
});

packages/kit-styled/src/components/input/input.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ export const Input = component$<InputProps>(
1010
name,
1111
error,
1212
'bind:value': valueSig,
13+
value,
1314
// eslint-disable-next-line @typescript-eslint/no-unused-vars
1415
'bind:checked': checkedSig,
1516
id,
@@ -19,7 +20,7 @@ export const Input = component$<InputProps>(
1920
const inputRef = useSignal<HTMLInputElement>();
2021

2122
// TODO: remove this when we can figure out why the optimizer forces you to have a signal rather than conditionally adding the bind:value prop.
22-
const dummySig = useSignal('');
23+
const dummySig = useSignal<string | undefined>(value?.toString());
2324

2425
return (
2526
<>

0 commit comments

Comments
 (0)