-
-
Notifications
You must be signed in to change notification settings - Fork 52
Open
Description
This example from the docs which defines an action, does not autofocus when you add the autofocus attribute
<TextField
label="Name"
autofocus
actions={(node) => [
debounceEvent(node, {
type: "input",
listener: (e) => {
// @ts-expect-error
console.log(e.target.value);
},
timeout: 500,
}),
]}
/>but if you remove the action then it starts working
<TextField
label="Name"
autofocus
/>I wouldn't expect those 2 things to effect each other.
as a workaround this should work:
<script>
import { autoFocus } from 'svelte-ux';
</script>
<TextField
label="Name"
actions={(node) => [
debounceEvent(node, {
type: "input",
listener: (e) => {
// @ts-expect-error
console.log(e.target.value);
},
timeout: 500,
}),
autoFocus(node)
]}
/>Metadata
Metadata
Assignees
Labels
No labels