Focus shift while searching the user directory

AI-generated summary

Users reported a UX issue in the Discourse user directory where typing too slowly in the search field causes focus to shift away—often to the “:heart: Received” column—triggering unintended keyboard shortcuts Moin. This behavior was contrasted with the group search, which allows unlimited pauses between keystrokes yaacobyy. The delay was estimated around 0.2–0.4 seconds Jagster, making the feature feel unusable for some admins. A fix was merged by nat, resolving the focus issue, but introduced regressions: broken table headers in plugins Moin and broken sorting in the user card directory component Moin. nat acknowledged the regressions and submitted follow-up fixes for the user card directory and custom fields on groups list, promising to close the topic after a final review for any additional regressions.

If you type not fast enough in the search field of the user directory, the focus shifts to :heart: Received, leading to the activation of keyboard shortcuts if you don’t notice.
Short screencast of the focus shift:

And one where, by trying to add a “u”, the keyboard shortcut is triggered:

5 Likes

Copied from here:
When I’m searching for a group name here and start to type, the search is filtered according to all the symbols I already typed after each symbol. I can wait as long as I want between the symbols.
However, when I search for a username here, after each symbol, I must type the next symbol after not more than ~0.4Sec or else, the results are filtered, and the cursor is no longer inside the search window, so I cannot continue typing (unless I put the cursor back inside the search window again and again after each symbol).

I reckon 0,2 sec is closer :winking_face_with_tongue: It has been such as long I’ve used Discourse. That’s why I think it is un-usable and I as an admin go to admin side if I need to operate with users.

2 Likes

Just merged a fix which should prevent this behaviour: https://github.com/discourse/discourse/pull/29209

5 Likes

Works great. Thanks.

But you broke the table headings for plugins.

1 Like

Yikes, thanks a lot.

8 Likes

I also have the impression that your changes also broke the User Card Directory component. At least I can no longer click on “:heart: received” or “:heart: given” in the cards view to change the order.

3 Likes

Appreciate your callout here @moin!

It also turns out there was another component affected

I’ll close this topic next week in case there are more that pops up but I did a quick scan and it looks like we’re fine.

5 Likes

This topic was automatically closed after 7 days. New replies are no longer allowed.