New issue
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
Uncaught TypeError: Cannot read property 'substr' of undefined #283
Comments
Check out this fiddle: https://jsfiddle.net/k7bozouk/ I think it's following what you want to do, and I'm not getting any errors. |
@mattboldt I ran If it helps, that error is pointing to line 230 which is in this block:
Im using it in a vue.js app and tested like so:
|
closing for inactivity. let me know if this issue still exists |
@mattboldt This issue does exist. Check it out here. https://jsfiddle.net/jchnx1u9/ |
The only difference I can see right now between mine and @rikakomoe's fiddle is that the initial strings array only has 1 item in it. I'll investigate further. |
Also got this error while using stringsElement option when the element doesn't have any other child elements. So I had to wrap the text in a span and the span wrapped inside the stringsElement element. |
@mattboldt This issue is still occurring actually, you need to wrap the |
@belyas yeah the docs say to wrap your HTML strings in a parent element: https://github.com/mattboldt/typed.js#strings-from-static-html-seo-friendly |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Description
When setting the strings property of a Typed instance to an array with length greater than 0 and resetting the instance with
Typed.reset();
the following error occures:this.typed_instance.strings = new_text;this.typed_instance.reset();
If you instead do:
it works fine.
Steps to Reproduce
var textArray = ["string", "string"];
typed.strings = textArray;
typed.reset(); // also tried passing true as argument
Expected behavior: resets the string array with a new one and properly progresses through a multimember array without throwing the error using the
reset()
method.Notes
Im just trying to update the same instance with new text arrays. Maybe the reset method wasnt meant for that and destroying the instance is correct.
The text was updated successfully, but these errors were encountered: