Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #10 (kind of)
This removes the setInterval for firefox, since it does not appear to be needed since firefox 55. I would suggest that if users need to support versions older than that, they can use something like https://github.com/2is10/selectionchange-polyfill. But calling a function every 16ms seems like overkill and a good way to drain batteries. I could be wrong about this, but it worked correctly in my version of firefox (95) in local testing.
I also updated the codesandbox slightly to fix an annoying chrome behavior, in which nothing appeared to be focused after resetting the input following an error. Maybe there's a better way to do that, but I couldn't find one.