Skip to content

Remove labelString from ListboxItem #2231

Closed

Description

@charliepark

The original intent of the labelString was that it would enforce a single line for the select box. Having a different component for the pseudo-select (button) and the pseudo-option (div) complicates things, though. If we must enforce single-lined-ness, we can do so with a non-wrapping flexbox, but we should be able to evaluate from the various callsites whether that's needed or not.

This will require going through a few locations in the app where we use it and making sure there aren't unintended consequences, but we can simplify how we're handling our listboxes.

Activity

  1. self-assigned this
    on May 7, 2024
  2. added this to the 9 milestone on May 13, 2024
  3. charliepark commented on May 15, 2024

    @charliepark
    ContributorAuthor

    There's another usecase that perhaps justifies having two different props here.

    Consider this scenario:
    Image

    Essentially, we have a "summary" template that we use when the item is selected, and then a more complete template that we show in the dropdown box.

    I think we might be fine to keep the concept of the labelString, but change the prop name to something a bit more descriptive of its purpose, and less tied to its type. So something like labelString → selectedLabel and (maybe) label → dropdownLabel. That way, we have a more clear sense of the context where the label will show up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions