-
-
Notifications
You must be signed in to change notification settings - Fork 529
Better keyboard navigation #3018
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
Better keyboard navigation #3018
Conversation
You can fix this by using the I think #1217 is more of a limitation with how ItemsView handles item focus by default. In fact, after pressing a package on the list arrow navigation works. Perhaps I could implement arrow press detection, and if the user presses an arrow key and no item is selected the first/last item could be manually selected and then focus given to the package list, so it feels more like the Windows explorer. If you want, I can do this. |
Ahh, OK. Done, thanks.
Yeah, I noticed this. #1217 was, I think, primarily about making it loop back around, but I've also noticed that occasionally using the arrow keys moves the ListView, not the focused element.
Yeah, this isn't that hard; fixed in 1d1ee33. I think the two solutions to making the keyboard navigation actually useful is that There are also a whole lot of |
I don't think the second is possible, do you think that forcing focus on the ItemsView on SelectAnScrollTo could fix the issue? |
Yeah, I'm pretty sure the problem is that while the item is selected, the focused item doesn't change, and the focused item is the one sending the event. |
Correction: forcing focus on the ItemsView wouldn't work, the focus has to be on the element being selected. |
I am then afraid that this issue cannot be fixed by a limitation on WinUI |
Ahh, that's unfortunate. I would've really appreciated this :( I suppose I should remove the arrow key code then, since it doesn't make much sense to a) hinder the default behavior and b) have arrow key selection that doesn't actually allow enter-for-package details. Is my assessment correct? |
Could I ask why not? Does the Sender expose something |
Tested it twice and didn't succeed. the |
I have been testing the code, and I have observed the following behaviour:
|
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.
Issue mentioned on the PR conversation
Anki is probably being selected because it's ID has a |
No, it's id is |
Well that's really bizarre then, I can't imagine why that would be. |
Please mark the conversation as resolved when you can fix the issue, thanks! |
I've made it so pressing the same key cycles through the items starting with that letter. I'll mark the review as resolved but I would like you to make sure it doesn't select |
Uhh... I'm not sure how... |
Any user suspected of farming GitHub activity with crypto purposes will get banned. Submitting broken code wastes the contributors' time, who have to spend their free time reviewing, fixing, and testing code that does not even compile breaks other features, or does not introduce any useful changes. I appreciate your understanding.
This pull request allows typing in a package list view to jump to that package, much like how Windows Explorer allows you to type out a file name on your keyboard outside of the search bar to jump directly to the file.
I tried to solve #1217 but I couldn't get
SelectedIndex
and such to work, so I ended up usingFilteredPackage.IndexOf(PackageList.SelectedItem)
and then after all of that apparently theSelect
call doesn't actually select the element and pressing enter would open the package details for the previously selected element, which I don't know how to fix (or even what the problem is). It occurs to me that this affects this code as well, but the main purpose is to focus the element on the screen.