You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
There's another usecase that perhaps justifies having two different props here.
Consider this scenario:
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.
Activity
charliepark commentedon May 15, 2024
There's another usecase that perhaps justifies having two different props here.
Consider this scenario:

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 likelabelString→selectedLabeland (maybe)label→dropdownLabel. That way, we have a more clear sense of the context where the label will show up.