ionic-framework: Serious bug or anomaly: Click event fired more than once using ionic module on iOS
Ionic version: [ ] 1.x [x] 2.0.0-rc.3 on iOS device, simulator and Ionic View on iOS.
I’m submitting a … [x] bug report [ ] feature request
Current behavior:
In the program, I simply created an ionic module (dummy.module.ts
) and create a page that will push another page (a component of a module). The component of the module does nothing beside doing push()
another detail dummy page. In the detail dummy page, I created a button which will call a function (tapMe()
) when I click on it. The function will print a string I call TapMe
to console.log. Here that is the problem appears, the click event is fired twice as a result the text is displayed twice. The problem only appears on iOS simulator, iOS real device & Ionic View.
2016-12-11 21:44:51.123 testapp[3771:105263] I call TapMe
2016-12-11 21:44:51.123 testapp[3771:105263] I call TapMe
In my real application, the click event is fired 12 times. I cant explain why click event is fired 12 times… but the number of times is not important, the expected behavior is that the click event should be fired once.
Expected behavior: Without the bug described above, the click event should be fired once.
Steps to reproduce:
For Ionic 2 issues [Repo] (https://github.com/sereysethy/testapp.git)
I also tested it against nightly build of ionic, the problem is the same.
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Reactions: 7
- Comments: 24 (4 by maintainers)
@sereysethy solved this issue on my app.
On your custom module, import the IonicModule without calling the forRoot() static method. Like this:
Hope it helps.
This framework is mind boggling and utter waste of time. Every new release comes with a new set of bugs without fixing the old bugs. I have a page where click events are firing 4 times in a row. While the other pages are fine. This problem is persistent in ion-checkbox on iOS where click event fires twice. If I change the handler to tap event then the scroll freezes on Android. So essentially if I want to support both iOS and Android then I can’t use either click or tap events. What a mess. I am not sure where the ionic team tests the code. They keep saying “We can’t reproduce”. This bug can be easily reproduced by having a scroll list with checkbox and testing it on iOS and Android devices.
the same situation
If it’s been solved, can you please post a specific link or validate this solution? We ran into this with the latest release and we don’t know where to begin to solve it.
Hi @mhartington and @sereysethy, thank you guys for the response.
@mhartington, i created a new issue and will post the repo there(#11881).
@sereysethy, will have a try, but i have some options inside
forRoot()
, not sure how i’m going to set options without that.@sereysethy that really isn’t the correct solution to the problem.
@matheusdavidson make sure you read the reply above provided by @paulogr, Call
IonicModule
without calling theforRoot()
static method.Having the same problem here!
Hey @jgw96 , any updates?
This is a serious bug, but ionic team seems to ignore it completely. It will affect all the apps on iOS @jgw96