orchidjs/tom-select

[Bug]: Input causes browser to crash of typing to fast or holding key down.

Opened this issue · 2 comments

Bug description

When holding a key down or typing too fast the browser tab get overloaded and will crash.

Expected behavior

There should not be a crash from input.

Steps to reproduce

  1. Click on the Tom select
  2. Hold any key down

Additional context

The problem stems from the onInput() function cause by the 'Input' event listener.

If searching is disabled this event listener seems to not be needed as it functions properly without it. Without the event listener there is no crash when holding a key down.

The function needs some optimizations to be able to not crash, it could be beneficial to add a delay before it accepts another event.

same problem

What browser are you using? I'm unable to reproduce this in the latest versions of either Chrome or Safari on the "Basic Examples" page of the docs (https://tom-select.js.org/examples/).