FormGroup not disabling on first try


#1

I have multiple FormGroups inside of an ion slider. When I try to disable my first FormGroup it does not disable on the first try, but when I try to disable it again immediately after, it does.

@ViewChild('slider') slider: any;

formA: FormGroup;
formB: FormGroup;

constructor() {
  // (FormGroup setup)
  this.formB.disable();
}

goToSlide(index: number) {
  // Disable current slide
  switch (this.slider.getActiveIndex()) {
    case 0:
      console.log(this.formA.disabled); // false
      this.formA.disable();
      console.log(this.formA.disabled); // false
      this.formA.disable();
      console.log(this.formA.disabled); // true
      break;
    case 1:
      console.log(this.formB.disabled); // false
      this.formB.disable();
      console.log(this.formB.disabled); // true
      break;
  }
  // Enable slide being navigated to
  switch (index) {
    case 0:
      this.formA.enable();
      break;
    case 1:
      this.formB.enable();
      break;
  }
  this.slider.slideTo(index);
}

My other FormGroups disable just fine after one .disable() call. Why is it just my first FormGroup that takes two .disable() calls for it to actually disable?