Page MenuHomePhabricator

TemplateWizard buttons (-/+ fields and 'add/remove all') do not activate on "enter"
Closed, ResolvedPublic1 Estimate Story Points

Description

When tabbing through the interface and landing the focus on the button, hitting "enter" (or 'space') does not activate the button.

This is even more crucial because of the routine that we're using to change the focus when adding and removing fields. If there are existing fields, we focus the first one, but if there are no existing fields, we focus the 'add all' button -- but then, keyboard actions don't work, which makes the focus senseless and a little frustrating.

This is actually a byproduct of OOUI actions. The button has 'click' listener, but also a keypress/keydown listeners, that are separate. All of those, however, emit 'click' event when an action is taken. Instead of extending onClick action (which only accounts for actual mouse click) we should listen to the internal event "click" and act on that.

Details

Related Gerrit Patches:
mediawiki/extensions/TemplateWizard : masterListen to click event instead of overriding 'onClick'

Event Timeline

Mooeypoo created this task.Aug 31 2018, 9:54 PM
Restricted Application added a subscriber: Aklapper. ยท View Herald TranscriptAug 31 2018, 9:54 PM

Change 456756 had a related patch set uploaded (by Mooeypoo; owner: Mooeypoo):
[mediawiki/extensions/TemplateWizard@master] Listen to click event instead of overriding 'onClick'

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

Change 456756 merged by jenkins-bot:
[mediawiki/extensions/TemplateWizard@master] Listen to click event instead of overriding 'onClick'

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

Mooeypoo closed this task as Resolved.Oct 23 2018, 10:55 PM
Mooeypoo moved this task from QA to Q2 2018-19 on the Community-Tech-Sprint board.