single-character-input-boxes icon indicating copy to clipboard operation
single-character-input-boxes copied to clipboard

Type to quickly Bug

Open yusuferenayas opened this issue 4 years ago • 5 comments

Hey everyone,

Creating this issue for this bug.

I am aware that there is a bug (mostly seems to occur in Chrome) where if you type to quickly sometimes the selection will spazz out and jump between inputs. I think it is a browser bug, but if anybody has any idea how to possibly fix this let me know please!

I think it's about pressing multiple key in same moment. If there is a some timeout callback that prevents key press for a while, like 100-200 ms. It might solve this problem.

yusuferenayas avatar Feb 22 '21 13:02 yusuferenayas

You can resolve this by wrapping _this3.focusNextChar(target); in a setTimeout function with 1ms delay in /dist/ReactIndividualCharacterInputBoxes.js I've made a package with this change https://www.npmjs.com/package/react-individual-character-input-boxes3

OneTuskedMario avatar May 20 '22 11:05 OneTuskedMario

I feel like I tried adding a delay once before but perhaps I didnt. Does it seem to have fixed the problem @OneTuskedMario ?

dannyradden avatar Sep 12 '22 00:09 dannyradden

So I messed around with different timeouts and 1ms doesnt seem to make much of a difference but 5ms pretty much eliminates the problem. Thanks for the help OneTusk. Ill be updating this soon

dannyradden avatar Sep 14 '22 00:09 dannyradden

So I messed around with different timeouts and 1ms doesnt seem to make much of a difference but 5ms pretty much eliminates the problem. Thanks for the help OneTusk. Ill be updating this soon

No problem @dannyradden, glad I could help. Thanks for this package :))

OneTuskedMario avatar Sep 14 '22 20:09 OneTuskedMario

After some more testing with timeouts it turns out that they don't actually seem to have any effect on the problem. Even set at 100ms it still jumps around, perhaps even more often. I am going to have to try to find a different way to fix the problem.

dannyradden avatar Sep 15 '22 23:09 dannyradden