You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
I have a long list of options divided into subsections and I would like to get title property of that option when that option is selected. Currently i only get the itemvalue like this
Additional context
Also is there a way to collapse all the sections inside the list? Since the option list becomes too long hence it difficult to scroll all the way to bottom
The text was updated successfully, but these errors were encountered:
Hello @Nulligma! You can write a utility function as shown below to extract the title from a given array
constgetTitleByValue=(array,valueToFind)=>{for(constsectionofarray){if(section.data.some(item=>item.value===valueToFind)){returnsection.title;}}returnnull;// or throw an error if preferred}
I have a long list of options like this
Is your feature request related to a problem? Please describe.
I have a long list of options divided into subsections and I would like to get title property of that option when that option is selected. Currently i only get the itemvalue like this
onValueChange={(itemValue: any) => setMenu(itemValue)}
Describe the solution you'd like
I would like to get option title as well so that I can sort my list better like this
onValueChange={(itemValue: any, itemTitle:string) => setMenu(itemTitle, itemValue)}
Additional context
Also is there a way to collapse all the sections inside the list? Since the option list becomes too long hence it difficult to scroll all the way to bottom
The text was updated successfully, but these errors were encountered: