question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

bug: The ionChange event of ion-input is triggered the second time the page is entered

See original GitHub issue

Bug Report

Ionic version:

[x] 4.x

Current behavior:

<ion-input [(ngModel)]="tests" (ionChange)="test($event)"></ion-input>

ngOnInit(
  this.tests = '123';
)

test($event){
 console.log('$event :', $event);
}

This is triggered the second time the page is accessed

Expected behavior:

If the user is not actively typing, no change event needs to be triggered

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:4
  • Comments:16 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
mread1208commented, Jul 14, 2020

We were able to get around this issue by using (ngModelChange)="" Instead of using (ionChange)=""

1reaction
Jay031commented, Apr 14, 2021

Same issue here, ionChange is triggered the second time the page is entered, any news on the fix?

Same issue here… april 2021 and counting…

Read more comments on GitHub >

github_iconTop Results From Across the Web

Ion-toggle (ionChange) triggered - Ionic Framework
IonChange triggers automatically. Ion-select unnecessarily triggers `ionChange` event when manually update or set value.
Read more >
IonInput: IonOnChange event firing twice - Stack Overflow
Current behavior: IonOnChange event for IonInput fires twice when ... and input is empty, then onChange event fires a 2nd time with value...
Read more >
Custom event types in Ionic | Damir's Corner
In Ionic 6, component events have well-documented, strongly typed arguments. This should allow them to be used in such event handlers:
Read more >
HTML onchange Attribute - W3Schools
Definition and Usage. The onchange attribute fires the moment when the value of the element is changed. Tip: This event is similar to...
Read more >
Angular and Ionic Date & Time Lifecycle events Example
The date picker ships with different event hooks for deep customization. Events are triggered through the lifecycle of the component where you ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found