I am making an autocomplete options in react app and generated the autocomplete field with list of options.
Working Example:
List of options:
const options = [
{ label: "hello", value: "1" },
{ label: "codesandbox", value: "2" },
{ label: "react", value: "3" },
{ label: "nodejs", value: "4" },
{ label: "java", value: "5" },
{ label: "antd", value: "6" },
{ label: "dependency", value: "7" },
{ label: "less", value: "8" }
];
Here if user select the data react, then the input has the value as 3 .
Expectation:
Expectation is that the input field needs to have the text as react but the selected value needs to be 3.
So for user display, it needs to be in text and the background value will be number.
Referred this post React Antd v4 autocomplete shows selected value instead of label upon selecting an option but it doesn't help in any way.