Page MenuHomePhabricator

OO.ui.BookletLayout.prototype.focusFirstFocusable doesn't find focusable elements very well
Closed, ResolvedPublic

Description

OO.ui.BookletLayout.prototype.focusFirstFocusable doesn't find focusable elements very well. For example, it misses our own ButtonWidgets. It should at least add '[tabindex]' to 'input, select, textarea, button, object' when finding elements to check. There is some interesting related discussion at T69156#1022986 onward. (Spotted by Anomie at https://gerrit.wikimedia.org/r/#/c/224966/5/src/widgets/CapsuleWidget.js,cm.)

(By the way, the method is duplicated as OO.ui.IndexLayout.prototype.focusFirstFocusable, we should put it somewhere else. We have OO.ui.isFocusableElement in core.js, that looks like a good place.)

Event Timeline

matmarex raised the priority of this task from to Needs Triage.
matmarex updated the task description. (Show Details)
matmarex added a project: OOUI.
matmarex added subscribers: matmarex, Mooeypoo.

Change 237480 had a related patch set uploaded (by Esanders):
Rewrite isFocusableElement for performance and correctness

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

Jdforrester-WMF triaged this task as Medium priority.
Jdforrester-WMF set Security to None.

I appreciate the patch, but it does not seem to be fixing this bug.

I was going off your comment on the other bug that referenced this one. I'll reassign it to T69156...

Mmm… focusFirstFocusable is actually unused. The part which I observed not working is something even simpler (a :input selector) and even more broken.

Change 239171 had a related patch set uploaded (by Bartosz Dziewoński):
BookletLayout, IndexLayout: Make autoFocus and focussing more reliable

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

Change 239171 merged by jenkins-bot:
BookletLayout, IndexLayout: Make autoFocus and focussing more reliable

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