ionic-framework icon indicating copy to clipboard operation
ionic-framework copied to clipboard

bug: Stopping scroll with tap fires click on views included from external file

Open PaperMonster opened this issue 11 years ago • 17 comments

Type: bug

Platform: all

I have a view containing a long list of clickable items. When I scroll/flick through the list and stop it by tapping, the list stops but fires the ng-click. This is similar to #1438 which was supposed to be fixed already in release 1.0.0-rc5. However, It still happens on my project using 1.0.0.

I made 2 Plunkers to repeat the problem: Undesired behavior and Desired behavior I found the problem occurs when I include the view template from external file (home.html), and doesn't when I move the view template to inline <script id="home.html"> tag in index.html. In other words, the clicks will not accidentally fired on the scroll views defined in index.html.

PaperMonster avatar Jun 09 '15 12:06 PaperMonster

this 'custom issue form' is so silly.

sclearion avatar Jun 09 '15 15:06 sclearion

Finally I was able to complete the custom issue form using my Android phone. Hope the form will work on my Mac soon.

PaperMonster avatar Jun 09 '15 16:06 PaperMonster

The custom issues form is meant to prevent duplicate issues and make sure we have all the necessary information when debugging. Nothing silly about that.

@PaperMonster, looking into the issue

mhartington avatar Jun 09 '15 16:06 mhartington

Well I guess the majority of ionic users are full of it. Sorry to offend, but you open an Issue via github but have to take additional steps, relinquish permissions to even get a response. Duplicate issues are going to happen unless EVERY ionic user was in communication about what issues are submitted already. Live and persistent issue moderation prevents duplicate tickets, not some lazy bot message

sclearion avatar Jun 09 '15 16:06 sclearion

@PaperMonster tested this out on an iphone5 running ios8 without any issues. What device were you testing on?

mhartington avatar Jun 09 '15 17:06 mhartington

@mhartington I tested on Nexus 5 Android 5.1.1 with Crosswalk.

PaperMonster avatar Jun 09 '15 18:06 PaperMonster

Tested on four more devices, now without Crosswalk.

  1. iPhone5 iOS 8.3 - No issue
  2. iOS Simulator, iPhone6 iOS 8.3 - Has issue
  3. Samsung Galaxy S Duos (GT-S7582L) Android 4.2.2 - Has issue
  4. Acer Liquid C1 i110 Android 4.1.2 - Has issue

After investigating a bit more, I discovered the problem occurs when 'tap to stop' fires ionic.tap.tapTouchEnd() before ionic.views.Scroll.doTouchEnd() which makes e.isTapHandled still be undefined at the time tapTouchEnd() consumes the variable.

PaperMonster avatar Jun 10 '15 05:06 PaperMonster

Hmm, still why does it not effect the inline template? @perrygovier, maybe you want to take a look at this with all the changes in native scrolling?

mhartington avatar Jun 10 '15 16:06 mhartington

Any update on that? We face the same issue on both Android and iOS.

samuelsmal avatar Oct 07 '15 16:10 samuelsmal

I'm experiencing the same issue on an iPhone 6s, iOS 9.1.

biesbjerg avatar Oct 28 '15 22:10 biesbjerg

It seems that only the ionic.view.Scrolls instantized after ionic.tap.register() will encounter this issue, due to the wrong event listeners execution order. So an ugly workaround is to re-register tap listenters after every scrollView instantized, like:

your_module.run(function () {
  var originalScroll, rebindTap;
  originalScroll = ionic.views.Scroll;
  rebindTap = ionic.debounce(function () {
    var deregister = ionic.tap.register(document);
    deregister();
    ionic.tap.register(document);
  }, 100);
  ionic.views.Scroll = function(options) {
    rebindTap();
    return new originalScroll(options);
  };
});

xiaody avatar Nov 16 '15 07:11 xiaody

I'm having the same problem on Android 5.1.1

nkeeslin avatar Nov 18 '15 21:11 nkeeslin

Having the same issue on an iPhone 6, iOS 9.1.

seasonstar avatar Dec 08 '15 03:12 seasonstar

+1

reapp3r avatar Jan 09 '16 11:01 reapp3r

Hello all! Is this still an issue with the latest version of ionic? Thanks!

jgw96 avatar May 05 '16 16:05 jgw96

Hello all! As it seems it has been a while since there was any activity on this issue i will be closing it for now. Feel free to comment if you are still running into this issue. Thanks for using Ionic!

jgw96 avatar May 10 '16 14:05 jgw96

Having the same issue on an iPhone 6, iOS 10.

MmtBkn avatar Sep 26 '16 05:09 MmtBkn