react-typed icon indicating copy to clipboard operation
react-typed copied to clipboard

startWhenVisible prop Bug

Open NaveedGujral opened this issue 1 year ago • 2 comments

There seems to be a bug when startWhenVisible=true and loop=true it seems like the component is mounting more than once causing it to look glitchy

I've attached screenshots of what i mean, it works fine without the startWhenVisible prop set to true.

I've had to use a intersection observer to mount and unmount the component instead if that helps.

Screenshot 2024-10-24 160709 Screenshot 2024-10-24 161117 Screenshot 2024-10-24 161140 Screenshot 2024-10-24 161151

NaveedGujral avatar Oct 24 '24 15:10 NaveedGujral

I can't replicate this. Seems to work as expected. Do you use intersection observer as a replacement for startWhenVisible?

ssbeefeater avatar Oct 27 '24 11:10 ssbeefeater

@NaveedGujral thanks for noticing this. Commenting startWhenVisible helped to fix it, because I got extremely glitchy behavior. @ssbeefeater pls see the attached video.

https://github.com/user-attachments/assets/ab069ad0-94ec-4df4-9c63-4a5d866f8f10

<ReactTyped
  // startWhenVisible
  strings={[
    'creative minds',
    'systemic results',
    'focused work',
    'ambitious goals',
    'building habits',
    'developing your network',
    'personal growth',
    'fun',
    'life',
  ]}
  backDelay={2100}
  typeSpeed={50}
  backSpeed={30}
  loop
/>

dmishh avatar Sep 30 '25 18:09 dmishh