mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 00:38:00 +08:00

When the usercard is opened, we manually assign focus to the first link to capture focus, but this creates an undesirable focus ring for visitors not relying on focus indicators for navigation. With this update, the focus is assigned to the container rather than the first link. This fulfills the goal of capturing focus within the user card, but hides the focus ring until navigation within the card begins. `tabindex="-1"` is necessary because this allows us to manually focus the container (normally unfocusable) while removing it from the tab order for subsequent navigation. Before:  After:  then on tab:  --------- Co-authored-by: Penar Musaraj <pmusaraj@gmail.com>