Closed Latgals closed 2 years ago
Having the same problem... unless we're missing something?
In the meantime, this is how I'm doing it:
const [index, setIndex] = useState();
const options = ["a", "b", "c"];
...
<Select selectedIndex={index} onSelect={setIndex} value={options[index.row]}>
{options.map((value)=><SelectItem title={value} key={value}>)}
</Select>
Seems like value
is what is displayed in the input box.
Having the same problem... unless we're missing something?
In the meantime, this is how I'm doing it:
const [index, setIndex] = useState(); const options = ["a", "b", "c"]; ... <Select selectedIndex={index} onSelect={setIndex} value={options[index.row]}> {options.map((value)=><SelectItem title={value} key={value}>)} </Select>
Seems like
value
is what is displayed in the input box.
Thanks to. With single select I solved the problem too. But with multiSelect not yet.
@Latgals
By default, Select
displays a value by building strings for selected indices. For a real-word examples, a value
property should be configured.
Please, take a look at the example 'Select Display Value'.
🐛 Bug Report
In the Expo application, the Select element does not select items from the list, but shows "Option 1", "Option 2", etc.
I copied the code from the UI Kitten documentation for the Select element and pasted it into my application. I just replaced the "title" value in with my own text. But the Select after selection still shows "Option 1", "Option 2", and not my items.
I have reproduced the bug at Expo Snack - you can check it here.
The same thing happens with the enabled and disabled multiSelect option.
How do I fix the bug?
UI Kitten and Eva version
Environment information
"expo": "~43.0.2", "react": "17.0.1", "react-dom": "17.0.1", "react-native": "0.64.3",