Page MenuHomePhabricator

Define the default width of the TypeaheadSearch's menu
Closed, ResolvedPublic

Description

Background

Currently, the menu of the TypeaheadSearch component in Vector takes the width of the input that triggers it by default, and expands to take the full width of the Search input + button when the viewport size is smaller than 1000px. All in order to keep the content readable:

Screenshot 2022-05-09 at 16.38.13.png (2,068×1,502 px, 553 KB)

Considerations

We have two options:

  1. Enabling the same behavior in the cdx-typeahead-search component in Codex (and make this configurable, ideally based on the component's width instead).
  1. Making the TahS menu's width take 100% of the component's width (input + button) by default. For the following reasons:
  • Would make the maximum amount of space available for options by default
  • The menu won’t edpend on the input's width, and shrink in case the copy of the button makes the input smaller
  • No need to include further, potentially complicated logic
  • We’d be following an existing pattern (e.g. the Combobox menu also takes the full with of the input + button that trigger it)

The main con:

  • We’d create some inconsistency in production, since current TahS components’ menus take only the width of their input by default too.

Screenshot 2022-05-09 at 17.36.10.png (1,472×868 px, 127 KB)

Event Timeline

Sarai-WMDE renamed this task from Define the default with of the TypeaheadSearch's menu to Define the default width of the TypeaheadSearch's menu.May 9 2022, 4:06 PM
Sarai-WMDE claimed this task.

Decision after design review: In order to avoid introducing such a visible inconsistency with similar components (see search component in Special search page), the default width of the TahS menu will correspond to the width of the search input, and exclude the button. The Codex team will discuss how to apply this "responsive" behavior to TahS, and how to make it customizable (New task: T308866: Apply responsive behavior to TypeaheadSearch menu).