greetings, I’m facing a problem with ionic-react in a multiselect, i’m when i select more than one option in my multiselect the is not show wing:
if i select only one option
and if i select more than only one i’m the selector stop showing data, i’m also printing the data.
all of this is happening in a React Functional Component (React.FC)
i’m using hooks to get and set data:
hook
const [riskForm, setRiskForm] = useState({
id: 0,
description: '',
category: 0,
inherentImpact: 0,
inherentChance: 0,
possibleEffects: [],
});
const { id, description, category, inherentImpact, inherentChance, possibleEffects } = riskForm;
Select tag:
<IonSelect
multiple
placeholder="Seleccione..."
name={'possibleEffects'}
value={possibleEffects}
onIonChange={e => updateFormRisk(e)}
>
{riskPossibleEffects().map((health: any, i: number) => (
<IonSelectOption key={i} value={JSON.stringify(health)}>
{health.title}
</IonSelectOption>
))}
</IonSelect>
onIonChange Function:
const updateFormRisk = (event: any) => {
setRiskForm({
...riskForm,
[event.target.name]: event.target.value,
})
};
of someone can help me with this i’ll appreciate it.