Is tick still needed in component like this? #16042
Replies: 3 comments 1 reply
-
In Svelte 5, you can use |
Beta Was this translation helpful? Give feedback.
-
If you need to wait for a DOM update caused by a data change that will be synchronized by Svelte, you need something like In this case you could also set the |
Beta Was this translation helpful? Give feedback.
-
You can also use getter/setter to intercept binding: <input type="text" bind:value={() => value, (v) => value = v.toUpperCase()} /> Though, it will work only if the formatted value is the same length or shorter. Otherwise, the cursor will be misplaced. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I have this Svelte 5 component.
Is there a better way to write this? Should I still use
tick()
with Svelte 5?Beta Was this translation helpful? Give feedback.
All reactions