Quantcast
Channel: Ionic Framework - Ionic Forum
Viewing all articles
Browse latest Browse all 49246

[Solved] Ion Select Selected Option

$
0
0

@FangerZero wrote:

Today I was auto filling a form, and noticed that if I put selected on the option it doesn’t actually show it as selected, but if you click into the select drop down it is selected, and when I click “ok” it displays correctly. Am I doing this correctly? adopting is set to whatever passes through to the component.


function getDogOptions(dogs) {
    const data = dogs.map((el, index) => {
      return (<IonSelectOption value={el.id} key={index}>{el.name}</IonSelectOption>);
    });
    return data;
 }
....
<IonSelect placeholder="Select a Dog" name="dog_1" onIonChange={e => updateForm(e, 'dog_1') }>
     { doggies && getDogOptions(doggies) }
</IonSelect>

Posts: 2

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 49246

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>