Page MenuHomePhabricator

Text input should still get focus when template insertion dialog opens
Closed, ResolvedPublic2 Estimated Story PointsBUG REPORT

Description

List of steps to reproduce:

  • Open visual editor for a given page
  • Type {{ or click Insert→Template
  • “Insert a template” dialog opens.

Actually:
The user has to manually click on template name text field or to press 4 times Tab key before they can type the name of the template they wants to insert.

Expected:
Focus should be given to template name field, to allow user to directly type the name of the template they wants to insert.

Possible regression causes:

Similar previous regression:

Event Timeline

@thiemowmde FYI, in case it's related to recent WMDE work. I'll investigate if it isn't.

I did a git bisect. The issue was introduced by patch https://gerrit.wikimedia.org/r/723137. The patch is valid, I would not revert it. Instead we need to find a better place to focus the search input when the dialog initially opens. @awight, can you have a look and find a place for this line? This is where the placeholder is initialized, but this is not where we can focus it.

thiemowmde set the point value for this task to 2.

It probably has to happen somewhere in getReadyProcess(), because in getSetupProcess() the dialog contents are not attached to the DOM yet. But you can probably have different behavior for editing a template and inserting one.

Change 726575 had a related patch set uploaded (by WMDE-Fisch; author: WMDE-Fisch):

[mediawiki/extensions/VisualEditor@master] Focus initial/single template placeholder

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

Change 726575 merged by jenkins-bot:

[mediawiki/extensions/VisualEditor@master] Focus initial/single template placeholder

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

Change 726906 had a related patch set uploaded (by Thiemo Kreuz (WMDE); author: Thiemo Kreuz (WMDE)):

[mediawiki/extensions/VisualEditor@master] Move some logic into the TransclusionModel class

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

Change 726906 merged by jenkins-bot:

[mediawiki/extensions/VisualEditor@master] Move some logic into the TransclusionModel class

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