Skip to content
This repository was archived by the owner on Sep 5, 2024. It is now read-only.
This repository was archived by the owner on Sep 5, 2024. It is now read-only.

7.1 - 8.3 Touch events not firing ng-click on Android/IOS hybrid apps/mobile browsers #1826

Closed

Description

@atentis

I have a hybrid app that is Ionic and Material. Performance was acceptable on on all versions of Material Angular below 8.0. 8.0 - 8.3 on the Ripple emulator works perfect but as soon as I deploy to a device the application is such a slug that it is completely unusable. I am not seeing any errors in visual studio.

This is my environment:
Material Angular 8.0 - 8.3
Ionic bundle: Ionic, v1.0.0-beta.14, angular 1.3.6
Visual Studio 2013 Community Edition w/ Cordova
Moto X 2013 Android 4.4.4

Any help would be greatly appreciated!

--Update 1--
I have discovered more information related to the issue. It looks like I was slightly incorrect in my op about a couple things...

  1. The issue is not necessarily that the app becomes slow as it is more of that the touch input is not registering very well. I have to tap many many times on any buttons or links that use ng-click to get them to finally register. It literally has to be very fast and repeated taps to get the click event to fire.
  2. It is not 8.0 and above, it is 7.1 and above. Basically the versions since hammer.js was removed.
  3. In addition to the android 4.4.4 device I have tried on another with 5.0.1 and it has the exact same issue.

--Update 2--
It is a conflict with the Ionic framework that started at version 7.1 of Angular Material. If you remove Ionic from your project the ng-click will work again

--Update 3--
I have confirmed this same issue happens not just in android apps but on android and IOS mobile websites as well. I have hosted a test site with material 8.3 here http://www.louspubcrawl.com/

Activity

  1. changed the title [-]8.x is very with an Android device using Cordova[/-] [+]8.x is performace poor with an Android device using Cordova[/+] on Mar 7, 2015
  2. changed the title [-]8.x is performace poor with an Android device using Cordova[/-] [+]8.x performace poor with an Android device using Cordova[/+] on Mar 7, 2015
  3. changed the title [-]8.x performace poor with an Android device using Cordova[/-] [+]8.x Performace poor with an Android device using Cordova[/+] on Mar 7, 2015
  4. gustavohenke commented on Mar 8, 2015

    @gustavohenke

    You should probably post some reproducible code.

  5. atentis commented on Mar 8, 2015

    @atentis
    Author

    @gustavohenke Do you have any suggestions on how I could do that? I do not have the issue in the web based ripple emulator which makes me believe if I build out my entire project into a plunker that I would have not have the issue there either. It seems as if it only happens when deployed to a device. Here is my index.html

    <head>
        <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, target-densitydpi=medium-dpi, user-scalable=0" />
        <link href="Content/ionic.css" rel="stylesheet"/>
        <link href="Content/angular-material.css" rel="stylesheet"/>
        <link href="Content/index.css" rel="stylesheet" />
    </head>
    <body ng-app="mgmtAppModule">
        <ion-nav-view name="loginContent"></ion-nav-view>
        <ion-nav-view></ion-nav-view>
        <!-- Cordova reference, this is added to your app when it's built. -->
        <script src="cordova.js"></script>
        <script src="scripts/platformOverrides.js"></script>
        <script src="scripts/index.js"></script>
        <script src="external/ionic.bundle.js"></script>
        <script src="external/angular-aria.js"></script>
        <script src="external/angular-resource.js"></script>
        <script src="external/angular-material.js"></script>
        <script src="external/angular-cookies.js"></script>
        //angular scripts for app...
          ....
    
  6. atentis commented on Mar 9, 2015

    @atentis
    Author

    I have discovered more information related to the issue. It looks like I was slightly incorrect in my op about a few things...

    1. The issue is not necessarily that the app becomes sluggish as it is more of that the touch input is not registering very well. I have to tap many many times on any buttons or links that use ng-click to get them to register. It literally has to be very fast and repeated taps to get the click event to fire.
    2. It is not 8.0 and above, it is 7.1 and above. Basically the versions since hammer.js was removed.
    3. In addition to the android 4.4.4 device I have tried on another with 5.0.1 and it has the exact same issue.
  7. changed the title [-]8.x Performace poor with an Android device using Cordova[/-] [+]7.1 - 8.3 Touch events not firing ng-click on Android device using Cordova[/+] on Mar 9, 2015
  8. atentis commented on Mar 9, 2015

    @atentis
    Author

    I have created a brand new Cordova Visual Studio project with only Angular Material, Ionc and their dependencies.
    If you include any version of Ionc with Angular Material 7.1 and up the Angular ng-clicks will not work on an Android app.

    Regular html buttons will not work with the ng-click at all and the material buttons will only work after many repeated presses. As soon as you remove Ionic OR downgrade to Material Angular 7.0 + Hammer.js the ng-clicks will work perfectly.

    <button type="button" data-ng-click="btnClick()">Click Me</button>
    <md-button class="md-raised gray-bg-btn" data-ng-click="btnClick()">Click Me</md-button>
    
    var app = angular.module('app', ['ionic', 'ngMaterial']);
    app.controller('ctrl', [ '$scope', function($scope) {
            $scope.btnClick = function() {
                alert("Button Clicked");
            }
        }
    ]);
    
  9. atentis commented on Mar 9, 2015

    @atentis
    Author

    Ok so I have found the issue is larger than just android hybrid apps. I have confirmed the issue happens even on a mobile website with IOS (Safari/Chrome) and Android (Chrome).
    Here is a test site to pull up on a mobile device to show it not working http://www.louspubcrawl.com/

    You can see the bottom material button will still respond but not consistently. The experience is even even worse on my cordova app.

  10. changed the title [-]7.1 - 8.3 Touch events not firing ng-click on Android device using Cordova[/-] [+]7.1 - 8.3 Touch events not firing ng-click on Android/IOS hybrid apps/mobile browsers[/+] on Mar 10, 2015
  11. added this to the 0.9.0 milestone on Mar 10, 2015
  12. thaiat commented on Mar 12, 2015

    @thaiat

    yep i am aware of that, the trick is to only integrate the ionic css when trying to work with both framework

  13. atentis commented on Mar 12, 2015

    @atentis
    Author

    @thaiat but then you cannot use the ion views, etc

  14. 12 remaining items

  15. DMDc0de commented on Mar 27, 2015

    @DMDc0de

    In which directive do you find scrolling is not working? For the md-select scrolling is working both on android and ios (for me at least). Do you want me to provide some code?

  16. bradmartin commented on Mar 27, 2015

    @bradmartin

    Scrolling will work, but if you attempt scrolling while tapping/holding an
    element with the data-tap-disabled attribute then you cannot scroll. This
    was the case when the original issue
    #1406 was opened on Feb. 5th. So
    maybe the data-tap-disabled has been improved to handle scrolling but from
    my testing you cannot begin scrolling if you are holding an element with
    data-tap-disabled="true" set.

    On Fri, Mar 27, 2015 at 10:50 AM, Daniele De Matteo <
    notifications@github.com> wrote:

    In which directive do you find scrolling is not working? For the md-select
    scrolling is working both on android and ios (for me at least). Do you want
    me to provide some code?

    —
    Reply to this email directly or view it on GitHub
    #1826 (comment).

  17. bradmartin commented on Mar 27, 2015

    @bradmartin

    I think this issue can be merged with #1406 and #1528. @marcysutton @ajoslin @ThomasBurleson

  18. wrousseau commented on Mar 29, 2015

    @wrousseau

    Is this still planned for 0.9.0 ?

  19. drastick commented on Mar 31, 2015

    @drastick

    I too would like to know if this is planned for 0.9.0

  20. rlucian commented on Apr 2, 2015

    @rlucian

    commit 7b78071 seems to be related to this bug and several other related bugs.
    could someone check and confirm?

  21. CR88 commented on Apr 2, 2015

    @CR88

    Using the rawgit references, and on Ionic, still broken.

  22. ThomasBurleson commented on Apr 2, 2015

    @ThomasBurleson
    Contributor

    @drastick - we are working on these gesture issues; targeted for the upcoming 0.9 release.

  23. badger27 commented on Apr 10, 2015

    @badger27

    also having this problem

  24. badger27 commented on Apr 10, 2015

    @badger27

    But it only happens after I build to a device. Tried all the above with no results.

  25. ThomasBurleson commented on Apr 13, 2015

    @ThomasBurleson
    Contributor

    For mobile solutions that are also using jQuery, you can now use $mdGestureProvider in

       app = angular.module('MyApp', ['ngMaterial'])
          .config(function( $mdGestureProvider ) {
              $mdGestureProvider.skipClickHijack();
          });

    This will configure $mdGesture to not intercept clicks (stop propagation and prevent defaults).

  26. debarko commented on Aug 4, 2016

    @debarko

    Thanks a lot for the above fix. It solved a huge issue which was causing a major headache for me.
    Angular Google Maps Directive Autosuggest stopped working since the touch wasn't reaching to the item in the list of suggested items. Finally this solved it.

  27. vasuvuggu commented on Feb 10, 2017

    @vasuvuggu

    Hi all, button events are not triggered in cordova ios mobile app,
    i have tried all of the options mentioned above.
    & deviceready event in cordova also not firing.
    Plz let me know if any suggestions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions