Closed frederikhors closed 1 month ago
I created a REPL for a strange issue.
REPL: https://stackblitz.com/edit/sveltejs-kit-template-default-9zkjpt?file=src%2Froutes%2Fabout%2FCustomSelect.svelte
Open the REPL
Open the browser console
Go on the "About" page using the link
No message in console
Now comment the line:
result = id;
And comment out the line:
// setTimeout(() => (result = id), 0);
Go on Home page
Go on About page
Now in the console you can see the message: "handleInput"
Why is this happening?
Is setTimeout really needed?
setTimeout
Maybe the issue https://github.com/rob-balfre/svelte-select/issues/682 is more accurate.
I created a REPL for a strange issue.
REPL: https://stackblitz.com/edit/sveltejs-kit-template-default-9zkjpt?file=src%2Froutes%2Fabout%2FCustomSelect.svelte
Steps to reproduce
Open the REPL
Open the browser console
Go on the "About" page using the link
No message in console
Now comment the line:
And comment out the line:
Go on Home page
Go on About page
Now in the console you can see the message: "handleInput"
Why is this happening?
Is
setTimeout
really needed?