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

Fix #182308: Pressing PageUp in the search panel no longer causes the layout to change. #213067

Merged
merged 3 commits into from
Jun 4, 2024

Conversation

franciscacarneiro
Copy link
Contributor

Fix #182308: Pressing PageUp in the search panel no longer causes the layout to change.

Bug (previous behavior):
1.Press Ctrl+Shift+F to open the search panel.
2.Enter any text into the search input.
3.Press PageUp/PageDown.
4.The layout shifts to the right, hiding the line that indicates the current tab in the activity bar.

Solution:
When search results are displayed, pressing PageUp or PageDown now moves the cursor to the start or end of the search input, respectively. This is achieved by assigning specific functionality to these keys, overriding their default behavior of moving through the page.

Testing:
A smoke test was implemented to assess the fix. The test involves entering text into the search editor, pressing the PageUp and PageDown keys, and checking for any changes in the activity bar's layout.

…auses the layout to change.

Bug (previous behavior):
    1.Press Ctrl+Shift+F to open the search panel.
    2.Enter any text into the search input.
    3.Press PageUp/PageDown.
    4.The layout shifts to the right, hiding the line that indicates the current tab in the activity bar.

Solution:
When search results are displayed, pressing PageUp or PageDown now moves the cursor to the start or end of the search input, respectively. This is achieved by assigning specific functionality to these keys, overriding their default behavior of moving through the page.

Testing:
A smoke test was implemented to assess the fix. The test involves entering text into the search editor, pressing the PageUp and PageDown keys, and checking for any changes in the activity bar's layout.
@franciscacarneiro
Copy link
Contributor Author

@microsoft-github-policy-service agree

@franciscacarneiro
Copy link
Contributor Author

Hello @andreamah ! If you have a chance, please checkout my PR as it is for a university project.
Thank you!

@andreamah
Copy link
Contributor

Interesting! Do you know why the layout changes in the original bug? I'm assuming that you overrode it with your call to keyboardEvent.preventDefault();?

@franciscacarneiro
Copy link
Contributor Author

Yes! Although I didn't find the exact cause of the issue, I suspected the unhandled key event might be misinterpreted by another component. Using keyboardEvent.preventDefault(); prevents this by stopping the default action, ensuring the event is only handled within the editor.

Copy link
Contributor

@andreamah andreamah left a comment

Choose a reason for hiding this comment

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

Looks like a good fix, thanks so much!

@VSCodeTriageBot VSCodeTriageBot added this to the June 2024 milestone Jun 4, 2024
@andreamah andreamah merged commit f93c5bc into microsoft:main Jun 4, 2024
6 checks passed
@franciscacarneiro
Copy link
Contributor Author

Thank you for your help!

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.

Pressing PageUp in search panel causes layout to shift
4 participants