lukePeavey / SplitType

Javascript utility that splits text into lines, words, characters for animation
https://lukepeavey.github.io/SplitType/
545 stars 39 forks source link

Calling split() more than once results in 'undefined' text #47

Closed danielkorte closed 1 year ago

danielkorte commented 1 year ago

Using the responsive text example code and resizing the window multiple times and you’ll see the issue: https://codepen.io/danielkorte/pen/OJEVRoN

The reason for the issue is split() calls revert() which calls SplitType.revert() which deletes the 'html' cached data so the second run of split() will again call revert() but 'html' will be undefined at that point.

lukePeavey commented 1 year ago

Yeah I see what you mean...

lukePeavey commented 1 year ago

@danielkorte Just released a patch for this. It should be fixed in 0.3.3. Thanks for reporting this!

Let me know if its working as expected in 0.3.3

danielkorte commented 1 year ago

Looks good to me — thanks!