The Wayback Machine - https://web.archive.org/web/20160419095950/https://phabricator.wikimedia.org/T76636
Jdforrester-WMF created this task.Via Web · Dec 3 2014, 7:34 PM
Jdforrester-WMF added a project: OOjs-UI.
Jdforrester-WMF moved this task to Backlog on the OOjs-UI workboard.
Jdforrester-WMF changed Security from none to None.
Jdforrester-WMF added a subscriber: Jdforrester-WMF.
matmarex added a subscriber: matmarex.Via Web · Jan 10 2015, 11:03 PM
Comment Actions

So in other words, make the weird tabindex hack in ButtonElement optional? Why do we even have this hack? (Why do we prevent "focus stealing"?) It was added in 2120e338e6605e076638c2d27a88e72756030d40 and there's no explanation there as to why.

matmarex added a subscriber: TrevorParscal.Via Web · Jan 15 2015, 10:54 PM
matmarex changed the task status from "Open" to "Stalled".Via Web · Feb 5 2015, 5:28 PM
matmarex lowered the priority of this task from "Normal" to "Low".Via Web · Feb 17 2015, 2:36 PM
matmarex added a subscriber: Anomie.Via Web · Mar 7 2016, 11:30 PM
Comment Actions

This indirectly caused issues in API sandbox, see T128054.

matmarex added a subscriber: TheDJ.
Comment Actions

@TrevorParscal, do you by any chance remember what was the rationale for buttons not taking focus when clicked?

@TheDJ, do you see any accessibility-related reason why buttons shouldn't take focus when clicked?

TheDJ added a comment.Edited · Via Web · Mar 10 2016, 8:21 PM
Comment Actions

it's probably done, because otherwise it steals the focus from the editable area, this is often not desired in toolbars for textual input (because you loose your cursor position).

For keyboard accessibility, you would therefor use keyboard combinations (as documented in the help) menu. you don't go hopping around with your focus to use a button, while you are trying to write text into an area.

For screen readers, the focus doesn't really matter, the focus (mostly) follows the accessibility cursor automatically.

matmarex added a comment.Via Web · Mar 10 2016, 8:28 PM
Comment Actions

Yeah, but we don't use ButtonElement in toolbars (e.g. in VE, the "Save page" button is the only actual button, everything else is toolbar stuff).

Prtksxna added a subscriber: Prtksxna.Via Web · Mar 11 2016, 7:57 AM
Comment Actions

I noticed that on Firefox and Chrome on MacOS the buttons don't get focus even after removing the hack from ButtonWidget. This is only the case with OOui buttons, normal buttons and links get focus, but not the visible focus state.

Explicitly giving them focus onMouseDown works

Prtksxna added a comment.Via Web · Tue, Apr 5, 12:39 PM
Comment Actions

I was looking at this again and apparently the explicit focus was required because ButtonElement sets cancelButtonMouseDownEvents to true. @matmarex, Would changing this for ButtonElement cause issues with the Toolbar?

gerritbot added a subscriber: gerritbot.Via Conduit · Tue, Apr 5, 12:41 PM
Comment Actions

Change 281638 had a related patch set uploaded (by Prtksxna):
ButtonWidget: Remove code to not let the button get focus after clicking

https://gerrit.wikimedia.org/r/281638

gerritbot added a project: Patch-For-Review.Via Conduit · Tue, Apr 5, 12:41 PM
matmarex added a comment.Via Web · Wed, Apr 6, 4:16 PM
Comment Actions

I was looking at this again and apparently the explicit focus was required because ButtonElement sets cancelButtonMouseDownEvents to true. @matmarex, Would changing this for ButtonElement cause issues with the Toolbar?

With Toolbar? Probably not. I have no idea if there's something that would be negatively affected. I think we should try and see.

Add Comment

Morty Proxy This is a proxified and sanitized view of the page, visit original site.