Skip to content

(ionChange) - unexpected behavior #17123

Closed

Description

@kamenkurtev

Bug Report

Ionic version:
[x] 4.0.0-rc.0

Current behavior:
(ionChange) trigger event without user interaction

Expected behavior:
(ionChange) should trigger event after user interaction

Steps to reproduce:

// Toggle or checkbox
// <ion-toggle (ionChange)="changeStatus($event)" [(ngModel)]="status"></ion-toggle>

status = true;

ngOnInit() {
  // this case work
  // this.status = false;
  
  // fetch status from a server
  // trigger change event without user interaction
  setTimeout(() => {
     this.status = false;
   }, 1000);
}

changeStatus($event) {
  // result: unnecessary request to the server
}

Activity

  1. manucorporat commented on Jan 15, 2019

    @manucorporat
    Contributor

    This is the expected behaviour, ionChange is emitted whatever the value of any input changes, no matter how it changed :)

  2. ionitron-bot commented on Feb 14, 2019

    @ionitron-bot

    Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.

  3. locked and limited conversation to collaborators on Feb 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions