# Set focus on usercard when activated by keyboard

**URL:** https://meta.discourse.org/t/set-focus-on-usercard-when-activated-by-keyboard/21968
**Category:** Feature
**Tags:** keyboard, user-card
**Created:** [November 9, 2014, 12:27pm UTC](https://meta.discourse.org/t/set-focus-on-usercard-when-activated-by-keyboard/21968 "2014-11-09T12:27:45Z")
**Posts on this page:** 15
**Page:** 1

<div class="post-metadata">

### Author: ![TechnoBear](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/technobear/32/40546_2.png) [@TechnoBear](https://meta.discourse.org/u/TechnoBear)
#### Post date: [November 9, 2014, 12:27pm UTC](https://meta.discourse.org/t/set-focus-on-usercard-when-activated-by-keyboard/21968/1 "2014-11-09T12:27:45Z")

</div>

Continuing the discussion from [New user cards and user profile page design deployed](https://meta.discourse.org/t/new-user-cards-and-user-profile-page-design-deployed/21660/27):

[quote=“codinghorror, post:27, topic:21660”]  
\<s\>We could just remove the Profile button, under the assumption that people know to click the name / avatar to get the full user page?\</s\>

This is now done. Get to profile by clicking / tapping the big user avatar or name on the expanded card.  
[/quote]If the usercard is activated by keyboard, it is currently necessary to tab through the entire topic before focus comes to the card, allowing access to the profile page.

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [November 9, 2014, 8:28pm UTC](https://meta.discourse.org/t/set-focus-on-usercard-when-activated-by-keyboard/21968/2 "2014-11-09T20:28:05Z")

</div>

Can you take this @eviltrout?

---

<div class="post-metadata">

### Author: ![eviltrout](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/eviltrout/32/5275_2.png) [@eviltrout](https://meta.discourse.org/u/eviltrout)
#### Post date: [November 10, 2014, 4:32pm UTC](https://meta.discourse.org/t/set-focus-on-usercard-when-activated-by-keyboard/21968/3 "2014-11-10T16:32:16Z")

</div>

[https://github.com/discourse/discourse/commit/9f127d8183ae4037fce4cd477927f1a5d50d7897](https://github.com/discourse/discourse/commit/9f127d8183ae4037fce4cd477927f1a5d50d7897)

Here, this should help 😄

---

<div class="post-metadata">

### Author: ![cpradio](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/cpradio/32/4970_2.png) [@cpradio](https://meta.discourse.org/u/cpradio)
#### Post date: [November 10, 2014, 4:36pm UTC](https://meta.discourse.org/t/set-focus-on-usercard-when-activated-by-keyboard/21968/4 "2014-11-10T16:36:25Z")

</div>

Something has massively regressed. Using j/k to select a post and then pressing tab no longer sets the focus to the avatar/username (for me at least here on meta).

I still can’t tab into a UserCard either…

Windows 7 Chrome 38

---

<div class="post-metadata">

### Author: ![TechnoBear](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/technobear/32/40546_2.png) [@TechnoBear](https://meta.discourse.org/u/TechnoBear)
#### Post date: [November 10, 2014, 4:39pm UTC](https://meta.discourse.org/t/set-focus-on-usercard-when-activated-by-keyboard/21968/5 "2014-11-10T16:39:52Z")

</div>

> [@cpradio](#):
>
> Something has massively regressed. Using j/k to select a post and then pressing tab no longer sets the focus to the avatar/username (for me at least here on meta).

Same here - although it’s working on SitePoint (probably until the next upgrade?). Firefox 33 on Ubuntu Gnome 14.04.

---

<div class="post-metadata">

### Author: ![eviltrout](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/eviltrout/32/5275_2.png) [@eviltrout](https://meta.discourse.org/u/eviltrout)
#### Post date: [November 10, 2014, 4:57pm UTC](https://meta.discourse.org/t/set-focus-on-usercard-when-activated-by-keyboard/21968/6 "2014-11-10T16:57:34Z")

</div>

Weird I’ll look into this ASAP

---

<div class="post-metadata">

### Author: ![cpradio](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/cpradio/32/4970_2.png) [@cpradio](https://meta.discourse.org/u/cpradio)
#### Post date: [November 10, 2014, 4:59pm UTC](https://meta.discourse.org/t/set-focus-on-usercard-when-activated-by-keyboard/21968/7 "2014-11-10T16:59:01Z")

</div>

I can’t verify it is directly related to your changeset, it may be another one involved too, but something happened, and it happened recently. ~~I’ll try looking at some commits in about 20 minutes or so to see if I can find it too.~~ Found it.

---

<div class="post-metadata">

### Author: ![cpradio](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/cpradio/32/4970_2.png) [@cpradio](https://meta.discourse.org/u/cpradio)
#### Post date: [November 10, 2014, 5:01pm UTC](https://meta.discourse.org/t/set-focus-on-usercard-when-activated-by-keyboard/21968/8 "2014-11-10T17:01:09Z")

</div>

Seems to be this change:  
[https://github.com/discourse/discourse/commit/d6ff1630a87349db754db8c0d1c6daa344ec840f](https://github.com/discourse/discourse/commit/d6ff1630a87349db754db8c0d1c6daa344ec840f)

---

<div class="post-metadata">

### Author: ![eviltrout](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/eviltrout/32/5275_2.png) [@eviltrout](https://meta.discourse.org/u/eviltrout)
#### Post date: [November 10, 2014, 5:05pm UTC](https://meta.discourse.org/t/set-focus-on-usercard-when-activated-by-keyboard/21968/9 "2014-11-10T17:05:17Z")

</div>

Thanks for tracking that down. I’ve got a fix:

> <https://github.com/discourse/discourse/commit/e1d26736b249c0e76f5ed19193e95261b1fbe1be>

---

<div class="post-metadata">

### Author: ![cpradio](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/cpradio/32/4970_2.png) [@cpradio](https://meta.discourse.org/u/cpradio)
#### Post date: [November 10, 2014, 5:09pm UTC](https://meta.discourse.org/t/set-focus-on-usercard-when-activated-by-keyboard/21968/10 "2014-11-10T17:09:08Z")

</div>

Interesting… I wouldn’t have thought of a href attribute without any value would fix this. I’ll give it another test in an hour or so here on Meta (how often does Meta get updated?)

---

<div class="post-metadata">

### Author: ![eviltrout](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/eviltrout/32/5275_2.png) [@eviltrout](https://meta.discourse.org/u/eviltrout)
#### Post date: [November 10, 2014, 5:09pm UTC](https://meta.discourse.org/t/set-focus-on-usercard-when-activated-by-keyboard/21968/11 "2014-11-10T17:09:52Z")

</div>

If tests pass, commits usually end up on meta in less than 15 minutes. I tested locally and that indeed fixes the problem 😄

---

<div class="post-metadata">

### Author: ![cpradio](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/cpradio/32/4970_2.png) [@cpradio](https://meta.discourse.org/u/cpradio)
#### Post date: [November 10, 2014, 5:11pm UTC](https://meta.discourse.org/t/set-focus-on-usercard-when-activated-by-keyboard/21968/12 "2014-11-10T17:11:15Z")

</div>

> [@eviltrout](#):
>
> If tests pass, commits usually end up on meta in less than 15 minutes

Cool, that’s good info to have 😄

> [@eviltrout](#):
>
> I tested locally and that indeed fixes the problem 😃

I don’t doubt that at all, I’m just really surprised that it works, so it is sort of: “I have to see this with my own two eyes” type of thing 😄

---

<div class="post-metadata">

### Author: ![eviltrout](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/eviltrout/32/5275_2.png) [@eviltrout](https://meta.discourse.org/u/eviltrout)
#### Post date: [November 10, 2014, 5:16pm UTC](https://meta.discourse.org/t/set-focus-on-usercard-when-activated-by-keyboard/21968/13 "2014-11-10T17:16:54Z")

</div>

Oh I don’t mind second guessing what I see!

hat really helps keeping the quality of our software high, as I miss little details all the time.

---

<div class="post-metadata">

### Author: ![cpradio](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/cpradio/32/4970_2.png) [@cpradio](https://meta.discourse.org/u/cpradio)
#### Post date: [November 10, 2014, 5:46pm UTC](https://meta.discourse.org/t/set-focus-on-usercard-when-activated-by-keyboard/21968/14 "2014-11-10T17:46:13Z")

</div>

Confirmed as working on Windows 7 Chrome 38. Thanks for the quick fix and the lesson on afterRender 😉 I may use that to solve a few other keyboard related issues that I’ve put on the back-burner for now.

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [November 10, 2014, 11:04pm UTC](https://meta.discourse.org/t/set-focus-on-usercard-when-activated-by-keyboard/21968/15 "2014-11-10T23:04:51Z")

</div>


