Page MenuHomePhabricator

When you choose a template that does not have TemplateData, Favourite Templates does not allow you to insert the template using the keyboard
Closed, ResolvedPublicBUG REPORT

Description

*Edit any article on the English Wikipedia. I use the 2010 editor toolbar with syntax highlighting enabled, but I assume this problem also occurs for those who use VE.
*Click the Favourite Templates button in the editor. The dialog pops up.
*Type "talkpagecool" into the search bar.
*It will give you 2 options, press Enter to select Talkpagecool, the top option.
*The dialog says: "No parameters could be determined for this template due to absence of TemplateData documentation. You may insert the template without parameters."
*You cannot insert the template using Ctrl-Enter. You have to click the button.

OK this is weird:
*If I search for Talkpagecool and then click the linked word Talkpagecool, it allows me to insert it with Ctrl-Enter.
*If I click on the "Talkpagecool" option but not on the word Talkpagecool itself (so somewhere to the right of it) then I can't insert the template with Ctrl-Enter.
*If I search for Talkpagecool, press Enter to select it then I can't insert then template with Ctrl-Enter.

It should be possible to open the Favourite Templates dialog, choose a template and insert it all without touching the mouse.

Latest Firefox on Pop OS.

Event Timeline

Polygnotus renamed this task from When you choose a template that does not have TemplateData, Favourite Templates does not allow your to insert the template using the keyboard in some cases. to When you choose a template that does not have TemplateData, Favourite Templates does not allow your to insert the template using the keyboard.Jul 11 2025, 10:56 AM
Polygnotus updated the task description. (Show Details)
Polygnotus renamed this task from When you choose a template that does not have TemplateData, Favourite Templates does not allow your to insert the template using the keyboard to When you choose a template that does not have TemplateData, Favourite Templates does not allow you to insert the template using the keyboard.Jul 11 2025, 11:16 AM

It looks like the difference between templates with params and those without is to do with where the input focus ends up. If any element in the dialog is focused, then ctrl-enter works as it should, but if none is then it doesn't. I think the fix is in TemplateWizard, making it focus something in that situation.

If we give focus to the template link button then the ctrl-enter works correctly, and seems like a sort of useful place to have focus then anyway (it's useful to open the template page and hopefully add TemplateData!).

image.png (318×712 px, 22 KB)

Change #1169808 had a related patch set uploaded (by Samwilson; author: Samwilson):

[mediawiki/extensions/TemplateWizard@master] Add fallback focus when opening templates with no templatedata

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

Change #1169808 merged by jenkins-bot:

[mediawiki/extensions/TemplateWizard@master] Add fallback focus when opening templates with no templatedata

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

dom_walden subscribed.

I have been able to insert the talkpagecool template on prod enwiki using ctrl+enter, regardless of how I select the template from the search menu.