I was able to get this working by running .stop() and using state.elements.wrapper.innerHTML to fill in the text - here's a snippet of what worked within my application (used currentTypewriter to store the typewriter and text strings):
let currentTypewriter:{
typewriter: TypewriterClass
text: string
}|null = null
const stopTyping = () => {
if (currentTypewriter) {
const { typewriter, text } = currentTypewriter
const { cursor, wrapper } = typewriter.state.elements
cursor.setAttribute('hidden', 'hidden')
wrapper.innerHTML = text
typewriter.stop()
}
}
I was able to get this working by running
.stop()
and usingstate.elements.wrapper.innerHTML
to fill in the text - here's a snippet of what worked within my application (usedcurrentTypewriter
to store the typewriter and text strings):