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

Fixes search suggestion issues with arrow keys #2371

Merged

Conversation

absidue
Copy link
Member

@absidue absidue commented Jul 1, 2022


Fixes search suggestion issues with arrow keys (RC branch)

Pull Request Type

  • Bugfix

Related issue
closes #1741

Description
This pull request fixes the cursor moving in the search bar when the up and down arrow keys are used to navigate through the search suggestions.
It also fixes the search suggestions being updated for all keyboard events even when the value of the search bar doesn't change (e.g. left and right arrow keys). Currently the search suggestions get updated for the input and keydown events, the input only gets fired if the value of the field changes, keydown is fired for all keyboard events.
It also replaces uses of the deprecated event.keyCode property with event.key, this improves code readability as you don't need to go and look up which key has which code.

Testing (for code that is not small enough to be easily understandable)

  1. Cycle through the search suggestions with the up and down arrow keys, the cursor in the search field should stay where you left it.
  2. Use the left and right arrow keys to move the cursor in the search field, if the initial value was typed in quickly, the search suggestions used to get updated for the left and right arrow keys.

Desktop (please complete the following information):

  • OS: Windows
  • OS Version: 10
  • FreeTube version: 7a374ac

@absidue absidue added the PR: waiting for review For PRs that are complete, tested, and ready for review label Jul 1, 2022
@PrestonN PrestonN enabled auto-merge (squash) July 1, 2022 23:03
Copy link
Collaborator

@PikachuEXE PikachuEXE left a comment

Choose a reason for hiding this comment

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

@PrestonN PrestonN merged commit d9bce86 into FreeTubeApp:v0.17.0-RC Jul 9, 2022
@github-actions github-actions bot removed the PR: waiting for review For PRs that are complete, tested, and ready for review label Jul 9, 2022
@absidue absidue deleted the fix-suggestions-changing-cursor-rc branch July 16, 2022 22:23
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.

5 participants