-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
ADD a timeout around the /
search hotkey, so it doesn't type into the input
#5702
Conversation
Why does it need to be 16ms? Is 0 not enough? |
I expected the question, @tmeasday I just pick 16ms, as that over the years seems to be the magic number that seemed to always work in stupid cases like this. It's roughly 1 animation frame. I could do requestAnimationFrame instead, but was like 🤷♀️ |
Codecov Report
@@ Coverage Diff @@
## next #5702 +/- ##
==========================================
- Coverage 33.24% 33.24% -0.01%
==========================================
Files 648 648
Lines 9363 9364 +1
Branches 1330 1355 +25
==========================================
Hits 3113 3113
- Misses 5635 5636 +1
Partials 615 615
Continue to review full report at Codecov.
|
@ndelangen I guess I ask because I would have guessed 0 would be enough--just need to get the focus behind the event handling, which happens synchronously |
@tmeasday I changed it |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great!
ADD a timeout around the `/` search hotkey, so it doesn't type into the input
Issue: #5419
What I did
I added a 16ms timeout before giving the input-element focus.
I know it may not be the cleanest solution, but in order to cancel the event, I'd need access TO the event, and that would require more refactoring then I'm comfortable doing at this stage of the release.