Part time open-sourcerer, linux enthusiast, Rust fanatic
Comment by ~henriquehbr on ~henriquehbr/svelte-typewriter
REPORTED
RESOLVED CLOSEDComment by ~henriquehbr on ~henriquehbr/svelte-typewriter
My apologies, you’re right, after taking a closer look on the problem, the culpirit turns out to be on some technical debt that was put in place in the years ago when the project was still getting started (around the time i was still learning Svelte)
The animation modes are dinamically invoked through
use
directives, all the props are grouped together and passed as a single object to these directives, once instantiated, the prop changes aren’t reflected back to these directives, which seems to be the root cause of the problem you’re describing, example below:<script> let counter = 1 const directive = (node, arg) => { console.log(arg) } </script> <h1 use:directive={{ counter }}>{counter}</h1> <button on:click={() => counter++}>change</button>
I think changing something like this would require way too much time and effort, and also probably incur breaking changes, but that’s just my two cents
Comment by ~henriquehbr on ~henriquehbr/svelte-typewriter
Whenever you change any component prop (or attribute, for that matter) it makes the whole
Typewriter
component reload, that's just how Svelte's reactivity works, i might be missing something here, but i'm not really sure if there's some way around that, but if you have any suggestions on how to get it done, i'm totally willing to implement it.Regarding this Firefox-related issue, it has been fixed on v3.2.3 (check #13), but the fix implemented to make the library work on Firefox breaks on the repl, that's why i had to downgrade one version to get it to work, sorry if the comment i left there was confusing.
Comment by ~henriquehbr on ~henriquehbr/svelte-typewriter
I'm not exactly sure if that's what you're looking for, but there's the
data-static
attribute for that, it skips the animation for the specified HTML elements marked with itExample:
<Typewriter> <p data-static>Hello</p> <p>World!</p> </Typewriter>
Comment by ~henriquehbr on ~henriquehbr/svelte-typewriter
REPORTED
RESOLVED CLOSEDComment by ~henriquehbr on ~henriquehbr/svelte-typewriter
The issue itself was fixed, but the fact that the chosen solution isn't natively supported on Firefox still stands, i've decided to just add a polyfill in the library instead of having each user go through this process themselves, a solution for this was released in version 3.2.3
I've tested it locally with Firefox 121.0 and everything seems to be working as expected, let me know if the problem persists for you
~henriquehbr assigned ~henriquehbr to #13 on ~henriquehbr/svelte-typewriter
Comment by ~henriquehbr on ~henriquehbr/svelte-typewriter
As the issue could not be reproduced, i'll be closing this due to inactivity
REPORTED
RESOLVED CLOSED~henriquehbr assigned ~henriquehbr to #12 on ~henriquehbr/svelte-typewriter
Comment by ~henriquehbr on ~henriquehbr/svelte-typewriter
Yes, it's still being maintained, but i'm mostly focused on bug fixing nowadays, can you share the repository where you're facing this error so i can take a better look at the issue, please?