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.
the same situation
This is a serious bug, but ionic team seems to ignore it completely. It will affect all the apps on iOS @jgw96
Same issue with RC4.
My workaround, removed all modules except of app module.
Without module, the app is very messy. Using no module is only for a very simple app.
Hey @jgw96 , any updates?
Having the same problem here!
@sereysethy solved this issue on my app.
On your custom module, import the IonicModule without calling the forRoot() static method.
Like this:
@NgModule({
imports: [
IonicModule, // without .forRoot(Component);
],
Hope it helps.
@paulogr Thank you very much, it solves my problem. I am not sure it is a bug of ionic or it is by design.
I'd like to add that I also had this problem, specific only to an iOS app running on device.
It occurred in Ionic2 release 2.0.0. due to a mistake I made.
I had IonicModule.forRoot(MyApp) listed twice in my app.module.ts
Once I removed the redundant line, everything worked as expected.
I am unable to reproduce this in any test.
Could you provide a more complete
I think this issue could be close.
This still happens slot in IOS, i had the same problem with a button inside ion-toolbar, ion-checkbox and many other components. Right now i have the same problem with Ionic 3 on IOS +10 on ion-checkbox, ngModel change twice.
@matheusdavidson Could you please provide an example in the form of a git repo. We have been unable to reproduce.
@matheusdavidson make sure you read the reply above provided by @paulogr, Call IonicModule
without calling the forRoot()
static method.
@sereysethy that really isn't the correct solution to the problem.
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.
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.
I have this bug everytime i start a new project and use ion-checkbox. I think this happens on iphone 5s (at least for me), the ionic team might be testing on the emulator or later iphone(6, 7).
@asaxena48, the bug with tap and scroll on android is solved, you just need to update your stack.
It also happens to me, in several places around the app. Unfortunately I can use the solution of removing the forRoot() method because I'm passing options to it.
Hi there folks. This issue has been solved some time ago. If this came back though, please open a new issue and provide a minimal example project that has the issue.
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.
@megajustice try to call IonicModule without calling the forRoot() static method in each module. By the way we decided to abandon Ionic because it does not support Desktop and there is no lazy loading. The Ionic team starts to announce PWA and shift their efforts from Ionic to PWA, to me Ionic will not get anywhere.
@sereysethy Thanks! We tried removing foroot and it caused a host of other issues. We finally fixed it. We wasted a couple of weeks fighting this and Android 7 lack of support for SQLite with Intercom. We have a specific build script that will get the app functioning with all associated dependancies. Blood, sweat and beers.
We got our app out the door, sure, it worked but the frustration, incompatibilities, build process and multiple developers debugging random device specific issues. Then iOS 11. Ugh.
Ionic 1, 2, 3, 4 and now 5 within a year? Now PWA. Forget it. I'm running a business with developers and customers that need something consistent and repeatable. If I could only go back in time, I could have saved tens of thousands of dollars NOT choosing this framework. It was my decision but we too are abandoning Ionic. Back to native. I love what the Ionic team is doing, they are great people and motivated. There are too many variables to manage and the market has shifted.
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.
Most helpful comment
@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.