Page MenuHomePhabricator

Customize the event type multiselect field
Open, Needs TriagePublic

Description

This is a follow-up to T386273. We discussed in some of our meetings that implementing it exactly as described in the task may or may not be feasible. For now, we will use this task to explore customization, while the original task will follow the default behavior of its OOUI component — which is simply to show an error message if the user selects the "Other" option along with any of the other available options.

I’ve created a patch that implements the required behavior, and I’ll attach it to this task for review by the engineering team. Depending on the outcome of the code review, it may or may not be viable, as the current approach is somewhat hacky and could be prone to bugs.

This task is meant to validate what level of customization we want to proceed with — or whether we want to customize it at all. We're also open to a smaller customization, such as displaying an error message immediately when the user selects both "Other" and any other option. This would prevent the user from submitting the form until the conflict is resolved.

Note that we will want to have this change assessed for accessibility by the design systems team.

Event Timeline

Change #1155286 had a related patch set uploaded (by Cmelo; author: Cmelo):

[mediawiki/extensions/CampaignEvents@master] Customize Event type field to handle the other option

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

Aklapper renamed this task from Customize the event type multselect field to Customize the event type multiselect field.Jun 11 2025, 9:23 AM
Daimona changed the task status from In Progress to Stalled.Jun 27 2025, 8:57 PM
Daimona subscribed.

We decided we'd reach out to Design-System-Team before continuing work on this.

Change #1155286 abandoned by Cmelo:

[mediawiki/extensions/CampaignEvents@master] Customize Event type field to handle the other option

Reason:

We receive a recommendation to not do it this way, so I am abandoning this patch.

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

Based on the feedback from the code review and internal discussions, we will not proceed with the current JavaScript-based solution, as it relies on modifying internal properties of the OOUI widget, which is fragile and could easily break with future updates to OOUI.

After evaluating the alternatives, we believe the valid options to move forward are:

  • Leave the current behavior as it is, showing an error message if the user selects both "Other" and another option and submits the form.
  • Separate the field into two distinct components, as recommended — for example, using a standard HTMLMultiSelectField for the predefined options and a separate checkbox or text field for "Other".
  • Create a new custom OOUI widget that extends MenuTagMultiselectWidget and encapsulates the behavior we want, combined with a custom HTMLFormField class that extends HTMLMultiSelectField.

@ifried

cmelo removed cmelo as the assignee of this task.Jul 24 2025, 4:49 PM
cmelo added a project: Connection-Team.