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

Avoid IonCheckbox, IonRadio, IonSelect Triggering ionChange On Initial Load

$
0
0

In Vue how do you set v-model or value of IonCheckbox, IonRadio, IonSelect, etc without triggering ionChange upon initial load?

For example for IonSelect the ionChange is triggered when the value is first set.

<ion-select v-model="value" @ionChange="saveValue">
  <ion-select-option :value="option" :key="index" v-for="(option, index) in section.options">{{option}}</ion-select-option>
</ion-select>

And same thing for IonRadioGroup.

<ion-radio-group v-model="value" @ionChange="saveValue">
  <ion-grid>
    <ion-row>
      <ion-col :key="index" v-for="(option, index) in section.options">
        <ion-item>
          <ion-radio slot="start" :value="option"></ion-radio>
          <ion-label>{{option}}</ion-label>
        </ion-item>
      </ion-col>
    </ion-row>
  </ion-grid>
</ion-radio-group>

I only want saveValue called after the user changes the value and not when it’s initially loaded, since I’m posting changes to the API.

1 post - 1 participant

Read full topic


Viewing all articles
Browse latest Browse all 48981

Trending Articles



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