Skip to content

Commit 015c790

Browse files
committed
feat: add custom event handlers to Input component
1 parent 8a797cc commit 015c790

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

src/routes/docs/forms/input-field.md

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,22 @@ text with one click.
116116

117117

118118
```svelte example
119-
hi
119+
<script lang="ts">
120+
import { Input, P } from "flowbite-svelte";
121+
let value = $state('Custom Event Handlers')
122+
</script>
123+
<P class="my-4">{value}</P>
124+
<Input
125+
bind:value={value}
126+
onInput={(e) => console.log('Custom input:', e)}
127+
onFocus={(e) => console.log('Input focused')}
128+
onBlur={(e) => console.log('Input blurred')}
129+
onKeydown={(e) => {
130+
if (e.key === 'Tab') {
131+
console.log('Tab pressed');
132+
}
133+
}}
134+
/>
120135
```
121136

122137
## Accessing Input Element with elementRef

0 commit comments

Comments
 (0)