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 scrolling with keyboard #10054

Merged
merged 3 commits into from
Dec 14, 2024
Merged

Fix scrolling with keyboard #10054

merged 3 commits into from
Dec 14, 2024

Conversation

timja
Copy link
Member

@timja timja commented Dec 12, 2024

See JENKINS-74984
#7569 (comment)

Testing done

Pressed up and down in system message text field, no console message
Scrolled the system configuration page, before fix didn't scroll, after fix scrolled.
Opened command palette, searched, used keyboard to navigate results
Closed command palette, can still scroll page with keyboard

Proposed changelog entries

  • Fix scrolling with keyboard

Proposed upgrade guidelines

N/A

Submitter checklist

Desired reviewers

@mention

Before the changes are marked as ready-for-merge:

Maintainer checklist

@timja timja added the bug For changelog: Minor bug. Will be listed after features label Dec 12, 2024
@timja timja marked this pull request as draft December 12, 2024 18:54
@timja timja requested a review from janfaracik December 12, 2024 21:34
@timja timja marked this pull request as ready for review December 12, 2024 21:34
@@ -81,7 +81,7 @@ export default function makeKeyboardNavigable(
}

function scrollAndSelect(selectedItem, selectedClass, items) {
if (selectedItem !== null) {
if (selectedItem) {
Copy link
Member Author

Choose a reason for hiding this comment

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

not strictly needed now but its more resilient

@@ -32,6 +32,8 @@ function init() {
searchResultsContainer,
() => searchResults.querySelectorAll("a"),
hoverClass,
() => {},
() => commandPalette.open,
Copy link
Member Author

Choose a reason for hiding this comment

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

only enables the keyboard navigation when the dialog is open which fixes it

@@ -32,6 +32,8 @@ function init() {
searchResultsContainer,
() => searchResults.querySelectorAll("a"),
hoverClass,
() => {},
Copy link
Member Author

Choose a reason for hiding this comment

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

would have been nicer if this was being passed an object so as I didn't have to pass this as well

@timja timja requested a review from a team December 12, 2024 21:35
@timja timja changed the title Adapt keyboard.js to handle undefined as well as null Fix scrolling with keyboard Dec 12, 2024
@timja timja added the regression-fix Pull request that fixes a regression in one of the previous Jenkins releases label Dec 12, 2024
Copy link
Contributor

@janfaracik janfaracik left a comment

Choose a reason for hiding this comment

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

Big thanks :) LGTM

Copy link
Member

@krisstern krisstern 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 this should fix the issue

@timja
Copy link
Member Author

timja commented Dec 13, 2024

/label ready-for-merge


This PR is now ready for merge, after ~24 hours, we will merge it if there's no negative feedback.

Thanks!

@comment-ops-bot comment-ops-bot bot added the ready-for-merge The PR is ready to go, and it will be merged soon if there is no negative feedback label Dec 13, 2024
@timja timja merged commit db744cc into jenkinsci:master Dec 14, 2024
16 checks passed
@timja timja deleted the fix-null-check branch December 14, 2024 11:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug For changelog: Minor bug. Will be listed after features ready-for-merge The PR is ready to go, and it will be merged soon if there is no negative feedback regression-fix Pull request that fixes a regression in one of the previous Jenkins releases
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants