We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
use:active breaks when removing a link from an #each array.
My example:
{#each testData as testItem} <li use:active={testItem.link, 'active' }> <a href={testItem.link} use:link>{testItem.name}</a> - <i on:click={() => removeData(testItem.id)}>X</i> </li> {/each} let testData = [ { id: 1, name: "link", link: "/hello/1" }, { id: 2, name: "link2", link: "/hello/2" }, { id: 3, name: "link3", link: "/hello/3" }, ]; function removeData(id) { testData = testData.filter(data => data.id != id); }
After a link in the array is removed, the active state remains frozen on the current one and does not change anymore.
Conversely, when a link is added, everything still works. Only if a link with a use:active is removed.
Right now I am looking into the problem...
I forked the example from this project and added code where the error occurs: https://github.com/TorstenDittmann/svelte-spa-router/tree/master/example
The text was updated successfully, but these errors were encountered:
8de3600
Version 1.2.1 is now on NPM with this fix. Thanks for your contribution!
Sorry, something went wrong.
You are welcome!
Merge pull request ItalyPaleAle#30 from TorstenDittmann/master
90b501d
fixed bug when element is destroyed Fixes ItalyPaleAle#28
No branches or pull requests
use:active breaks when removing a link from an #each array.
My example:
After a link in the array is removed, the active state remains frozen on the current one and does not change anymore.
Conversely, when a link is added, everything still works. Only if a link with a use:active is removed.
Right now I am looking into the problem...
I forked the example from this project and added code where the error occurs:
https://github.com/TorstenDittmann/svelte-spa-router/tree/master/example
The text was updated successfully, but these errors were encountered: