Open supersational opened 2 years ago
A work around that will fix this is adding a key to your each block. Repl demo adjusted: https://svelte.dev/repl/ec2d95279a8b4dc4b148bc4e5a85e255?version=3.46.4
aside from that, I'm not sure what causes the difference here from the native example (maybe something to do with how slots render) but overall the effect is due to how each blocks work in svelte which is why it's generally recommended to key an array in your #each if you are going to be modifying them. See here: https://svelte.dev/tutorial/keyed-each-blocks
The following example shows the Sveltestrap input behaving differently to a regular input component.
REPL: https://svelte.dev/repl/35220d0977954638ab45e96c718eb893?version=3.46.4
The inputs should both have the '1' option selected.