typed.js icon indicating copy to clipboard operation
typed.js copied to clipboard

Option to place cursor IN the target

Open stevenvachon opened this issue 8 months ago • 4 comments

Because my target is a <p> and the cursor is always displayed beneath. I've had to add a nested <span> to avoid this.

stevenvachon avatar Apr 16 '25 01:04 stevenvachon

What is your workaround exactly? Can you show an example?

yelizariev avatar Apr 17 '25 07:04 yelizariev

I had <p id="target">content</p> and had to change it to <p><span id="target">content</span></p> so that the cursor would remain in the <p>

stevenvachon avatar Apr 17 '25 18:04 stevenvachon

I see. It's not enough in my case because I have multiple <p>. I made a patch in #628

yelizariev avatar Apr 18 '25 13:04 yelizariev

I ran into a similar issue. Initially I solved it by wrapping the target in a container that has display: "flex". It worked well enough for short strings, but failed when the string wrapped in the container. To solve that, I think the insert character logic needs to be updated and the cursor character needs to be present as the last character in the string being typed.

decisiveJoe avatar Sep 16 '25 14:09 decisiveJoe