react-native-modal-selector icon indicating copy to clipboard operation
react-native-modal-selector copied to clipboard

Option to format selected values

Open baba43 opened this issue 6 years ago • 1 comments

Hello,

first, let me thank you for this great project. It's really what we were looking for.

We want to use this component to create some kind of filter selection. The idea was that the component itself shows Filter by <anything> and <anything> is what the user should actually select in the dialog. Now our problem is that we can not differentiate between displayed label and lable within selection.

So my question is, if it is possible to differentiate between those two label locations?

baba43 avatar Sep 23 '18 19:09 baba43

The data passed to ModalSelector may contain anything you like. Taking the example from the Readme and modifying it:

        const data = [
            { key: index++, section: true, label: 'Fruits', myCustomId: 98123 },
            { key: index++, label: 'Red Apples', myCustomId: 87943 },
            { key: index++, label: 'Cherries', myCustomId: 23590 },
        ];

With that example, you could use myCustomId to uniquely identify the selected item. Does that solve your problem?

peacechen avatar Nov 07 '18 15:11 peacechen