-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dropdown can not display selected element (string is fine) #5698
Comments
Hi 👋 is your desired UX close to #2571, or something else? |
The design I got is a single choice dropdown, and the each option is shown like a Tag component like the screenshot I pasted above. Now I can render the dropdown options as design, but the selected item only can be shown as a string due to this bug. |
Thanks @ilovepumpkin - In case the design doesn't contain any confidential contents - Would you be able to post some of them here so our designers can see if it's acceptable in Carbon design ecosystem? |
A developer in the team wants to restrict the contents in the trigger button, due to an alleged risk of our promise in a feature set broken by custom content. OTOH, I can see more flexibility there would be desirable for some use cases (despite of that risk), but I don't have a concrete use case that our designers can see it's valid. That's where my previous question came from. Does it make sense? Update: Seems that you got that design from your designer. If so, wondering if your designer have talked to our designers on this design? |
I guess not, :D. I will let her know about this. Thanks! |
I just wanted to chime in here and clarify that the design intent is not to have custom options like tags inside of the dropdown component. Similarly, custom items should not render in the field position. The rationale for this is that it can create some confusion UX-wise around how to use the control (for example if it looks like a multi-select but doesn't behave like one) Feel free to reach out on #carbon-design-system on Slack if there are any concerns with this! For folks on the team, can see our recent thread on the support channel for the resolution 👍 |
What package(s) are you using?
carbon-components
carbon-components-react
Detailed description
I am using itemToElement to show my dropdown options, but now Dropdown can not show the selected element because the line " {selectedItem ? itemToString(selectedItem) : label}" should try to invoke "itemToElement" if it is available but now only string can be displayed .
This is my expected result
The text was updated successfully, but these errors were encountered: