Post navigator keeps keyboard focus when entering post number

AI-generated summary

A user, JBert, reported a bug with the post navigator. When entering a post number and pressing Enter, the keyboard focus remains on the navigator, preventing the use of cursor keys to navigate posts. This issue occurs in desktop browsers and on mobile devices. eviltrout identified the bug as Firefox-specific and provided a fix in a commit.

I frequently use my keyboard’s cursor keys when going through longer topics as I’m prone to wrist pain when using the scroll wheel for long periods.

What I noticed is that the cursor keys stop working when doing the following:

  • Go into any sufficiently long topic, e.g. the missing plugins thread.
  • Click the post navigator to open it fully.
  • Select the post number, replace it with e.g. 200.
  • Press Enter. (this is the important step, clicking “go” appears to work)
  • The post navigator closes and you are taken to the requested post.
  • Press Up / Down on the keyboard. This won’t do anything.

Notice that on mobile (Android in my case) the focus also stays if I press Return from the on-screen keyboard (the “go” button is rather hard to hit accurately). While not blocking I still see the Copy / Cut / Paste controls overlay there until I open the post navigator again or dismiss the overlay.

2개의 좋아요

Hmm seems like a legit bug @eviltrout

Curiously it only happened in Firefox for me. Here’s a fix:

https://github.com/discourse/discourse/commit/d7ee07483781adbd83bbf09b2c86c3cc94c4214a

Thanks for reporting it!

3개의 좋아요