Set focus on usercard when activated by keyboard

keyboard

(TechnoBear) #1

Continuing the discussion from New user cards and user profile page design deployed:

[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.


(Jeff Atwood) #2

Can you take this @eviltrout?


(Robin Ward) #3

https://github.com/discourse/discourse/commit/9f127d8183ae4037fce4cd477927f1a5d50d7897

Here, this should help :smile:


(cpradio) #4

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


(TechnoBear) #5

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


(Robin Ward) #6

Weird I’ll look into this ASAP


(cpradio) #7

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.


(cpradio) #8

Seems to be this change:
https://github.com/discourse/discourse/commit/d6ff1630a87349db754db8c0d1c6daa344ec840f


(Robin Ward) #9

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


(cpradio) #10

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?)


(Robin Ward) #11

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


(cpradio) #12

Cool, that’s good info to have :smile:

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 :smile:


(Robin Ward) #13

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.


(cpradio) #14

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


(Jeff Atwood) #15