Skip to content

[Select] Move alignItemToTrigger from Root to Positioner #1711

Open
@atomiks

Description

@atomiks

Bug report

The previous implementation required the prop to be on the Root, but this is no longer the case with the latest one, as it can exist on Positioner instead which makes more sense in the API.

@DiegoAndai @aarongarciah you mentioned possibly changing the name, which we could also do simultaneously here.

An actual proper description of the behavior is more like:

<Select.Positioner alignSoThatSelectedItemTextIsOverTriggerValueText>

Which is obviously unrealistically verbose, but is more accurate as the prop aligns the Positioner element, not the Item element, so the selected item text inside of it visually appears directly aligned with the Trigger Value text.

It also disables the other anchoring-related props and enters a "special positioning mode"

<>
  <Select.Positioner align="selected" />
  <Select.Positioner overlayTriggerValue />
  <Select.Positioner alignToTrigger />
  <Select.Positioner anchorMode="selected-item|trigger" />
  <Select.Positioner positioningMode="selected-item|trigger" />
</>

Metadata

Metadata

Assignees

No one assigned

    Labels

    breaking changecomponent: selectThis is the name of the generic UI component, not the React module!

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions