-
The value inside on onChange function is "reflected by the selected option" as mentioned in the doc. But having the value containing the label is not useful for me. I couldn't find a way to remove the labels from the values themselves. Is there a way to do this with typescript or some prop? Or do I have to clean my values each time I have to submit them and remove the labels? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
This discussion has been brought up a few times, and there are some past examples I've given for how to extract the value(s) from the selected option(s). Here is the most in depth discussion on the topic: #175 Read through that first and let me know if it doesn't answer your question. Overall, I personally recommend removing the labels on submit, as the boilerplate for removing them in a generic way can get very large (especially in TypeScript). |
Beta Was this translation helpful? Give feedback.
-
Appreciate the prompt answer. I thought this can be done without extra logic like some sort of prop or ts generic that I can use to exclude the label from the value. I will parse the value on submit for the time being, hopefully in the future they can consider removing the label from the value) |
Beta Was this translation helpful? Give feedback.
This discussion has been brought up a few times, and there are some past examples I've given for how to extract the value(s) from the selected option(s). Here is the most in depth discussion on the topic: #175
Read through that first and let me know if it doesn't answer your question. Overall, I personally recommend removing the labels on submit, as the boilerplate for removing them in a generic way can get very large (especially in TypeScript).