Page MenuHomePhabricator

TextInput, Select, and Combobox: Reconsider min-width set
Closed, ResolvedPublic

Description

Context/background

Currently, TextInput, Select, and Combobox have a min-width of 256px. This is applied in code and in Figma.

Problem

In certain layouts, such as some new designs, the form itself has a max-width of 512px, determined in the Constructing forms guidelines in the Style Guide and meant to prevent unnecessarily long inputs when desired in forms. In such cases, when there is a fieldset or multiple columns, two fields next to one another using a TextInput and Select, for example, need to be shorter than 256px. Example below.

Screenshot 2024-03-01 at 1.18.31 PM.png (540×1 px, 40 KB)

Proposed solution

To ensure flexibility and ability to create certain interfaces, I propose we remove the restriction on the component, and instead lead with guidance on why 256px is the preferred min-width, except when labels and input values will be short, even when translated to other languages, etc. etc. This guidance would be provided on the Field component page.

Final decision

As discussed internally with the DST, the 256px min-width implemented in code can be overwritten by CSS, so it could be customized in some cases to a smaller width if necessary. So we will maintain the base min-width 256px in Select, TextInput, and Combobox as it is now.

Acceptance criteria (or Done)

  • Figma library:
    • Figma component: remove the min-width in Select, TextInput, and Combobox
    • Figma specs: clarify that the default min-width is 256px to prevent errors, but it can be customized to a smaller size if necessary.

Future task
  • Guidelines in Codex: Include the same information as in Figma in the new "Minimum and Maximum". This will be done in T358859.

Event Timeline

I agree on removing the min-width 256px from TextInput since there will be some cases where a smaller input could be needed. Another solution could be to implement a smaller min-width in TextInput (e.g. 128px).

One of the reason this came up was folks have designed for English and not taken i18n into consideration when designing before min-width.

Volker_E renamed this task from Reconsider min-widths on certain form elements to TextInput, Select, and Combobox: Reconsider min-width set.Mar 6 2024, 6:01 PM
Volker_E added a project: CSS.
Volker_E added a project: Design.

Per DST Design Sync today, we decided we should remove the min-widths from these components, but we should consult with engineering first to learn of potential concerns removing this after it has already been added.

As discussed internally with the DST, the 256px min-width implemented in code can be overwritten by CSS, so it could be customized in some cases to a smaller width if necessary. So we will maintain the base min-width 256px in Select, TextInput, and Combobox as it is now.

Here's the plan:

  • Code: No action needed
  • Figma library: Remove the min-width from the Figma components in Select, TextInput, and Combobox and clarify in their spec sheets that the default min-width is 256px to prevent errors, but it can be customized to a smaller size if necessary.
  • Guidelines: Include the same information as in Figma in the new "Minimum and Maximum" section being worked in T358859.

Thanks for adding this @bmartinezcalvo. Should this task be marked as resolved now? cc @CCiufo-WMF

bmartinezcalvo closed this task as Resolved.EditedMar 7 2024, 2:27 PM
bmartinezcalvo claimed this task.

Thanks for adding this @bmartinezcalvo. Should this task be marked as resolved now? cc @CCiufo-WMF

I've removed the min-width in the Figma components (TextInput, Select, and Combobox) and I've included the following notes in the Min-Max examples in their specs:

"The base min-width implemented and recommended is @size-1600 (256px). Anyway, this min-width can be customized to a smaller width if necessary."

I will document the same in the components Guidelines in T358859. So resolving this task.