Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Throttle key events #670

Merged
merged 1 commit into from
Apr 22, 2020
Merged

Throttle key events #670

merged 1 commit into from
Apr 22, 2020

Conversation

mason-fish
Copy link
Contributor

fixes #591

I also had noticed that cmd+w was closing the whole window instead of just the tab, so fixed that too (prevent default)

Signed-off-by: Mason Fish [email protected]

@mason-fish mason-fish requested review from a team and jameskerr April 22, 2020 19:36
throttle((e) => {
e.preventDefault()
dispatch(adjustSelectedLogIndex(1))
}, 200)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I experimented w a few values here, this seemed to be the fastest that my computer could handle without any odd glitching, and it still feels plenty fast to me

Copy link
Member

@jameskerr jameskerr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right on.

}, 200)
)
Mousetrap.bind("mod+t", () => dispatch(Tabs.new()))
Mousetrap.bind("mod+w", (e) => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🙇‍♂️ Thank you! That had been bothering me so much!

@mason-fish mason-fish merged commit b2d1ee7 into master Apr 22, 2020
@mason-fish mason-fish deleted the 591-debounce_key branch April 22, 2020 23:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

repeated key navigation for log detail locks up UI
2 participants