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

ListBox (Select) doesn't scroll when using keyboard arrows #52

Closed
panoukos41 opened this issue Apr 5, 2024 · 5 comments
Closed

ListBox (Select) doesn't scroll when using keyboard arrows #52

panoukos41 opened this issue Apr 5, 2024 · 5 comments
Assignees
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@panoukos41
Copy link
Contributor

Hey, as I was trying the ListBox with a lot of items I noticed that the keyboard doesn't scroll the list. The items get's selected etc but you can't actually see it.

Actual behavior
msedge_6

Expected behavior (from official library)
msedge_4

@DavidVollmers DavidVollmers self-assigned this Apr 6, 2024
@DavidVollmers DavidVollmers added the bug Something isn't working label Apr 6, 2024
@panoukos41
Copy link
Contributor Author

Hey @DavidVollmers are you working on this or could I give it a try? I implemented a search just like html select element using the onkeydown on a ListBox. It scrolls the itme found in place so I would love to give it a try and then maybe try to PR my implementation for the search using keydown as a feature 😃

@DavidVollmers
Copy link
Owner

Hey there!

Feel free to give it a try, although the scroll implementation will be a little bit tricky here.

The keydown logic is implemented here:

public static void OnKeyDown(this IAriaPopup popup, KeyboardEventArgs eventArgs)

But I think the best way to solve this issue is to overwrite the OnAfterOpen logic in all popups to scroll to its active descendant.
For the listbox this could happen here:

protected override void OnAfterOpen(Action? continueWith)

@DavidVollmers DavidVollmers added the good first issue Good for newcomers label Apr 22, 2024
@DavidVollmers
Copy link
Owner

We should fix this for all popups though. This means we should implement it in a way we can reuse the logic for the Listbox, Popover and Menu component.

@panoukos41
Copy link
Contributor Author

I see, I will give it a try with that in mind!

@DavidVollmers
Copy link
Owner

This is fixed with release 1.4.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants