typewriterjs icon indicating copy to clipboard operation
typewriterjs copied to clipboard

Feature Request: Method to ClearAll immediately.

Open wparad opened this issue 1 year ago • 7 comments

Instead of deleting all the typed characters, DeleteAll just starts deleting the characters one by one. How do I delete all the typed characters in one single moment?

One would expect the DeleteAll command to do this but it doesn't. However from the discussion below, it seems this "confusing behavior" is intended and won't be fixed. So instead can I recommend a new command "ClearAll" that performs action.

wparad avatar Sep 20 '23 18:09 wparad

Have you considered using the changeDeleteSpeed() prop? It wouldn't make sense for all characters to disappear in one go as it defeats the purpose of a typewriter effect, would it?

kenshanta avatar Jan 03 '24 15:01 kenshanta

I think so, and 0 wasn't fast enough.

It wouldn't make sense for all characters to disappear in one go as it defeats the purpose of a typewriter effect, would it?

That's just a weird thing to say. Forward is great, backward is terrible. If you are only going to delete some characters, then it makes sense to show what you are deleting, but if you want to clear everything, there is just no way to do that. Even if changeDeleteSpeed worked, basically that would be a huge hack that would require a bunch of changes to make the right thing happen.

The use case, clearAll, it would seem that is exactly the purpose of deleteAll from a user perspective, but if the library wants to use those words to mean something else that's fine.

If we want to stand on principle rather than usefulness, then feel free to call a new method: throwPageAway(), that would work fine for me.

wparad avatar Jan 03 '24 15:01 wparad

the value of 0 throws back to the natural deleting speed. try 1

kenshanta avatar Jan 03 '24 16:01 kenshanta

too-slow

I don't think we are on the same page here, I'm looking for instant delete everything and start over. This is deleteAll(1), this is not the same as clear().

wparad avatar Jan 03 '24 16:01 wparad

I understood your requirement clearly. however the issue should be under a different title. maybe a proposal to include clearAll feature of it already exists to fix it

i Suggest you close/edit this issue and provide a better brief about what is it that you want

kenshanta avatar Jan 11 '24 13:01 kenshanta

All the details are in this thread, I'm not sure why I would close this issue. That doesn't make any sense.

wparad avatar Jan 11 '24 13:01 wparad

Same question. I use recursive function in the callFunction to achieve this. image You can try this if you need.

marshall-li avatar May 13 '24 08:05 marshall-li