Search code examples
angularcordovaionic2win-universal-appwinjs

Windows tap takes long to respond


I've created an Ionic 2 app. Now I have my buttons set up like this:

<button class="my-button" (tap)="doSomething()" tappable></button>

Now the tappable should remove the 300ms delay on a tap.

The ionic docs aren't too great on gestures but here's a demo of how tap should work

The problem I encounter is that, when I build for windows, the buttons still are very slow to respond to a tap event. Why is this? On iOS and Android, they're both very quick.

I thought it might have to do with loading pages after clicking a button but this isn't the case since normal buttons on a page

$ cordova platform version windows
 Installed platforms:
  android 5.0.0
  ios 4.3.1
  windows 4.4.3

Please note that using (click) instead of (tap) doesn't solve the issue.

Edit 1: In the emulator this issue does not occur.


Solution

  • Turns out this is an ionic specific issue.

    After updating my ionic versions, creating a new project and copying all my pages and logic from my previous project to the new, the taps, clicks and animations are now really fast.

    Commands I used:

    • npm uninstall -g ionic cordova
    • npm install -g ionic cordova
    • (copy src, assets, config.xml, index.html)
    • ionic cordova run windows --prod --release --arch="arm"

    Previous ionic versions:

    $ ionic info
    
    Your system information:
    
    Cordova CLI: 6.4.0
    Ionic Framework Version: 2.3.0
    Ionic CLI Version: 2.2.1
    Ionic App Lib Version: 2.2.0
    Ionic App Scripts Version: 1.3.7
    ios-deploy version: Not installed
    ios-sim version: Not installed
    OS: Windows 10
    Node Version: v6.9.1
    Xcode version: Not installed
    

    New ionic version:

    $ ionic info
    
    cli packages: (C:\Users\ivaro18(no-not-serious)\AppData\Roaming\nvm\v6.9.1\node_modules)
    
        @ionic/cli-utils  : 1.9.2
        ionic (Ionic CLI) : 3.9.2
    
    global packages:
    
        Cordova CLI : 7.0.1
    
    local packages:
    
        @ionic/app-scripts : 2.1.3
        Cordova Platforms  : android 6.2.3 windows 5.0.0
        Ionic Framework    : ionic-angular 3.6.0
    
    System:
    
        Android SDK Tools : 25.2.2
        Node              : v6.9.1
        npm               : 3.10.8
        OS                : Windows 10