[question] Help with a feature in Autocomplete #38624
Labels
component: autocomplete
This is the name of the generic UI component, not the React module!
support: Stack Overflow
Please ask the community on Stack Overflow
Duplicates
Latest version
Steps to reproduce 馃暪
The issue is, that I have this list of options:
[{id: 1, value: 1, label: 'Company1'},{id: 2, value: 2, label: 'Company2'}]
I'm using the Autocomplete component and I want to set as a value only the ID, but display the label.
Store as a value ONLY the ID.
I already tried with getOptionLabel, with getOptionSelected (deprecated).
The issue is that I'm getting undefined on the getOptionLabel, because the value is being changed only for the ID.
Currently my code is:
Current behavior 馃槸
Displaying the label, but I
Expected behavior 馃
No response
Context 馃敠
No response
Your environment 馃寧
npx @mui/envinfo
The text was updated successfully, but these errors were encountered: