[Dropdown]: option to call itemToElement for selectedItem not just list of items
See original GitHub issueSummary
We’ve been highjacking the itemToString
function in the Dropdown to create an IconDropdown component for selecting warning icons. We simply returned an object from itemToString
, and this worked well until 10.43/7.43 when the title attribute was added to the button in the Dropdown. However, now, visually it still works, but we get title="[Object object]"
in the output of the selected icon. Would it be possible to add a prop to determine which function (itemToElement
or itemToString
) is used to render the selected item in the dropdown?
CodeSandbox example: https://codesandbox.io/s/goofy-water-2o4d4?file=/src/index.js
Justification
No response
Desired UX and success metrics
No response
Required functionality
No response
Specific timeline issues / requests
No response
Available extra resources
I can write the PR.
Code of Conduct
- I agree to follow this project’s Code of Conduct
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (6 by maintainers)
Top Results From Across the Web
drop down list not updating selected item on subsequent calls
if I put a breakpoint on ddlyear.SelectedItem.Value.ToString(); the value actually never changes form the first call. it will change once, to ...
Read more >How to get selected value in dropdown list using JavaScript
In this article, we will learn to get the selected values in the dropdown list in Javascript. We can get the values using...
Read more >useSelect | Downshift
It returns a set of props that are meant to be called, and their results destructured on the dropdown's elements: its label, toggle...
Read more >@unicef-polymer/etools-dropdown - npm
Polymer 3 dropdown element with searchable options, ... the id/optionValue of the selected item ... Selected value not found in options ...
Read more >select and dropdown - Carbon Design System
The select component allows users to choose one option from a list. ... a list of options from which the users can select...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
The carbon team is always open for contributions
https://github.com/carbon-design-system/carbon/blob/main/.github/CONTRIBUTING.md
(not carbon team member)
@joshblack Sure thing: https://codesandbox.io/s/goofy-water-2o4d4?file=/src/index.js I added a bunch of comments to clarify.