Page MenuHomePhabricator

PageTitlesControl does not clear input when selecting a title from the dropdown
Closed, ResolvedPublicBUG REPORT

Description

Steps to replicate the issue (include links if applicable):

  • Have a CommunityConfiguration schema with PageTitlesControl
  • Enter a value (e.g. Template:) to trigger the dropdown of values
  • Select a title (e.g. Template:CN)

What happens?:
Template:CN is added as a chip. The text Template: remains in the input

What should have happened instead?:
Template:CN is added as a chip. The text Template: disappears.

Software version (on Special:Version page; skip for WMF-hosted wikis like Wikipedia):

  • MediaWiki: 1.45.0-alpha (bbb4b1b)
  • CommunityConfiguration: (71e5de9)
  • Google Chrome (macOS 15.5): Version 137.0.7151.120 (Official Build) (arm64)

Other information (browser name/version, screenshots, etc.):

image.png (390×718 px, 38 KB)

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

Some quick poking at this found another "non-Vue" hacky way of dealing with this :3

diff --git a/resources/ext.communityConfiguration.Editor/lib/json-form/controls-codex/src/mediawiki/PageTitlesControl.vue b/resources/ext.communityConfiguration.Editor/lib/json-form/controls-codex/src/mediawiki/PageTitlesControl.vue
index a35e1f6..904f58b 100644
--- a/resources/ext.communityConfiguration.Editor/lib/json-form/controls-codex/src/mediawiki/PageTitlesControl.vue
+++ b/resources/ext.communityConfiguration.Editor/lib/json-form/controls-codex/src/mediawiki/PageTitlesControl.vue
@@ -135,8 +135,11 @@ module.exports = exports = {
                                } ];
                                onChange( selection.value.map( chipToPageTitle ) );
                                currentSearchTerm.value = '';
-                               // HACK, bettwer way to remove the user typed text in ChipInput?
-                               input.value.inputValue = '';
+                               // also a HACK to clear the input text
+                               if ( input.value && input.value.input ) {
+                                       input.value.input.value = '';
+                                       input.value.input.dispatchEvent( new Event( 'input', { bubbles: true } ) );
+                               }
                        },
                };
        },

Additional note - a user should be able to dismiss the input, when no selection was made, by clicking outside of the suggestion drop-down list.
Current behavior:
Template: input will be added even if a user doesn't select a template from the drop-down suggestions:

  • a user types Template: and sees the drop-down list of suggestions
  • a user decides not to select anything and clicks outside the drop-down selection list to cancel the action of typing a template name
  • Template: will be entered and a user needs to delete it by clicking on x or manually delete the input before clicking outside the drop-down list
EMcFarland-WMF changed the task status from Open to In Progress.Dec 17 2025, 3:24 PM
EMcFarland-WMF claimed this task.

Change #1227830 had a related patch set uploaded (by EMcFarland; author: EMcFarland):

[mediawiki/extensions/CommunityConfiguration@master] PageTitlesControl: Clear input from after user selects a title from the dropdown menu.

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

Change #1227830 merged by jenkins-bot:

[mediawiki/extensions/CommunityConfiguration@master] PageTitlesControl: Clear input after user selects a title from the dropdown menu.

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

Checked on testwiki wmf.14 - the issue in the task description is fixed, i.e.

What happens?:
Template:CN is added as a chip. The text Template: remains in the input

Note:

Screenshot 2026-02-11 at 10.21.18 AM.png (670×1 px, 130 KB)
Screenshot 2026-02-11 at 10.21.30 AM.png (1×1 px, 188 KB)