You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When typing in inputs, there is no lag if I type slowly but as soon as I start typing quickly, the lag gets so bad that characters don't show on the screen and then all appear at once about three seconds after I finish typing.
This happens whenever I add one or more hotkeys but doesn't happen if I only import the library and service without adding a hotkey.
Looking into the underlying library (mousetrap), I registered one hotkey (ctrl+right arrow), pressed a single quick keypress in an HTML input (I tapped "j" once), and saw the following function calls in the mousetrap library:
As you can see, _handleKeyEvent gets called 6 times. I'm guessing the buildup of those calls as I type is what slows the characters from showing in the input.
Looking into the issue on stackoverflow, I see a similar issue with a jQuery library: "The keydown event in combination with an html textbox will not be sufficient to prevent it from being fired multiple times." Is mousetrap being connected to the keydown and that's firing multiple times?
The text was updated successfully, but these errors were encountered:
When typing in inputs, there is no lag if I type slowly but as soon as I start typing quickly, the lag gets so bad that characters don't show on the screen and then all appear at once about three seconds after I finish typing.
This happens whenever I add one or more hotkeys but doesn't happen if I only import the library and service without adding a hotkey.
Looking into the underlying library (mousetrap), I registered one hotkey (ctrl+right arrow), pressed a single quick keypress in an HTML input (I tapped "j" once), and saw the following function calls in the mousetrap library:
_handleKeyEvent
_characterFromEvent
_eventModifiers
Mousetrap.prototype.handleKey
self._handleKey
_getMatches
_handleKeyEvent
_characterFromEvent
_eventModifiers
Mousetrap.prototype.handleKey
self._handleKey
_getMatches
_handleKeyEvent
_characterFromEvent
_eventModifiers
Mousetrap.prototype.handleKey
self._handleKey
_getMatches
_handleKeyEvent
_characterFromEvent
_eventModifiers
Mousetrap.prototype.handleKey
self._handleKey
_getMatches
_handleKeyEvent
_characterFromEvent
_eventModifiers
Mousetrap.prototype.handleKey
self._handleKey
_getMatches
_handleKeyEvent
_characterFromEvent
_eventModifiers
Mousetrap.prototype.handleKey
self._handleKey
_getMatches
As you can see,
_handleKeyEvent
gets called 6 times. I'm guessing the buildup of those calls as I type is what slows the characters from showing in the input.Looking into the issue on stackoverflow, I see a similar issue with a jQuery library: "The keydown event in combination with an html textbox will not be sufficient to prevent it from being fired multiple times." Is mousetrap being connected to the keydown and that's firing multiple times?
The text was updated successfully, but these errors were encountered: