readthedocs / addons

JavaScript client to integrate with Read the Docs nicely
https://readthedocs-addons.readthedocs.io/
MIT License
20 stars 5 forks source link

Search: unusual scrolling behavior when using arrow keys #398

Open thephez opened 3 weeks ago

thephez commented 3 weeks ago

I'm trying to get search working as I had it before using the extension (mostly there). I noticed this unexpected behavior when trying to scroll with the arrow keys. I recorded my screen so I didn't have to try to explain :smile: Basically, the arrow seems to do random things. In this video, I only pressed the down arrow. Sometimes it moved down, sometimes up, and some keystrokes don't do anything at all :shrug:

You can experiment here and see if you experience the same thing. It's not page-dependent, but this is the one I was on when recording the video: https://docs.dash.org/projects/core/en/rtd-search-fix-2024-10-08/docs/dashcore/wallet-arguments-and-commands-dash-cli.html

https://github.com/user-attachments/assets/a71e6dfc-a3ad-4cd0-991a-2267f54cadcf

thephez commented 3 weeks ago

Watching the video, I noticed there is an almost unnoticeable highlighting. Looks like it's supposed to loop back to the top of the list when it gets to the bottom? However, there are 8 items found (across 6 pages) and not all items are hit sometimes. It seems like I can get to all items if the mouse is not over the results window. But the mouse focus throws something off so it doesn't actually cycle through all results, but sometimes prematurely returns to the beginning of the list?

I dunno, hopefully some of that helps.

humitos commented 3 weeks ago

Basically, the arrow seems to do random things. In this video, I only pressed the down arrow. Sometimes it moved down, sometimes up, and some keystrokes don't do anything at all 🤷

I think you can iterate only over specific results inside pages with the keyboard, but not in the titles of the pages. Is this correct? @zanderle

Looks like it's supposed to loop back to the top of the list when it gets to the bottom?

Yes.

But the mouse focus throws something off so it doesn't actually cycle through all results, but sometimes prematurely returns to the beginning of the list?

I think if you hover on a result with the mouse, the index for the keyboard is reset and start from 0 again.


I understand this is not super intuitive and weird UX, but I guess it's how it works for now 😄 . We should define how we want to work on all these cases, and implement it as an improvement.

zanderle commented 3 weeks ago

I think you can iterate only over specific results inside pages with the keyboard, but not in the titles of the pages. Is this correct? @zanderle

Correct 👍