You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Sep 5, 2024. It is now read-only.
Repository navigation
This repository was archived by the owner on Sep 5, 2024. It is now read-only.
<md-button> ng-click fires inconsistently with Ionic Framework/ng-Material latest versions #1406
The plunker above works fine, I found this on the Ionic Framework forums and it's functional and the click is fired as expected.
However the same code with the latest ionic css/js files along with latest Angular Material via bower install, the click doesn't work as intended. Any reason? I've also installed the #master but the clicks on md-button still don't work very well. It may fire once every 10-20 clicks, and sometimes it fires once every 5 clicks. This is a hangup for me right now on moving forward with a project.
Note: ng-click is broken on touch devices and Chrome emulation of such. Chrome desktop is unaffected. The Codepen above: works fine using 0.6.1 or 0.7.0 -- broken on 0.7.1.
I suspect it might be because of the hammer.js change on 0.7.1 - Ionic has a similar built-in version of hammer as well...
Can you verify whether this issue still exists in 0.8.0-rc1? Hammer.js was removed in 0.7.1 in favor of $mdGestures, so it's very likely because of that.
Anyone? is this going to be fixed? I need to know what the plan is? do i need to drop angular-material and move to something where clicks work on mobile devices?
I tried using this and my Ionic Cordova App fails because Angular is throwing me an error:
Uncaught ReferenceError: jQueryisnotdefined
I had to do some code changes to make it work without an error.
Before:
varself={handler: addHandler,register: register,// On mobile w/out jQuery, we normally intercept clicks. Should we skip that?isHijackingClicks: (isIos||isAndroid)&&!JQuery&&!forceSkipClickHijack};
After:
varhasJQuery=typeofjQuery!=='undefined'&&angular.element===jQuery;varself={handler: addHandler,register: register,// On mobile w/out jQuery, we normally intercept clicks. Should we skip that?isHijackingClicks: (isIos||isAndroid)&&!hasJQuery&&!forceSkipClickHijack};
@jonathan68 you are using AngularJS Material with Ionic 2 or Angular Material with Ionic 2? For Angular Material, you can ask questions in their forums.
Activity
mikkokam commentedon Feb 6, 2015
Note: ng-click is broken on touch devices and Chrome emulation of such. Chrome desktop is unaffected. The Codepen above: works fine using 0.6.1 or 0.7.0 -- broken on 0.7.1.
I suspect it might be because of the hammer.js change on 0.7.1 - Ionic has a similar built-in version of hammer as well...
drastick commentedon Feb 20, 2015
I'm having issues with this as well.
marcysutton commentedon Feb 20, 2015
Can you verify whether this issue still exists in 0.8.0-rc1? Hammer.js was removed in 0.7.1 in favor of $mdGestures, so it's very likely because of that.
bradmartin commentedon Feb 20, 2015
@marcysutton Yes it still exists.
stellasoft-will commentedon Feb 21, 2015
this is an issue for me as well @marcysutton
mikkokam commentedon Feb 21, 2015
http://forum.ionicframework.com/t/is-there-a-tutorial-for-using-ionic-and-angular-material/14662/14
isaiahaguilera commentedon Feb 25, 2015
I am at a loss with this bug as well. Is there a version that has the autocomplete before hammer was removed?
bradmartin commentedon Feb 25, 2015
No, autocomplete wasnt implemented until after hammer was removed.
On Feb 24, 2015 7:41 PM, "iaaguilera" notifications@github.com wrote:
jeffthompson1971 commentedon Feb 26, 2015
Is there an ETA for a fix or do I just rip it revert to an older version for the near future?
bradmartin commentedon Feb 26, 2015
@jeffthompson1971 - @ThomasBurleson added it to the 0.9.0 milestone over a week ago, so just keep checking for updates.
jeffthompson1971 commentedon Feb 28, 2015
Anyone? is this going to be fixed? I need to know what the plan is? do i need to drop angular-material and move to something where clicks work on mobile devices?
21 remaining items
sebmaniac commentedon May 12, 2015
I tried using this and my Ionic Cordova App fails because Angular is throwing me an error:
I had to do some code changes to make it work without an error.
Before:
After:
ThomasBurleson commentedon May 12, 2015
@sebmaniac - great catch. This should be improved with the commit SHA a22f681
ashishtilara commentedon Jun 13, 2015
thank you @ThomasBurleson,
$mdGestureProvider.skipClickHijack();trick works perfectly for meyxh10 commentedon Feb 24, 2016
@ThomasBurleson FYI, this is happening again to Material v1.0.0 onwards.
However, the solution
$mdGestureProvider.skipClickHijack();works nicely.
ikhsanputra07 commentedon Apr 14, 2016
@ThomasBurleson thanks for your solution. it Works perfectly. Great
ilkayhan commentedon Apr 26, 2017
" $mdGestureProvider.skipClickHijack(); " Where to write it? @ThomasBurleson ,
thomcom commentedon Jun 7, 2017
@ilkayhan first import
angular-materialto get$mdGestureProvider, then do it in app.config.daweedm commentedon Jun 14, 2017
Could there be a similar issue with the
blurevent firing when it is not necessary ? (Using along ionic-v1)ThomasBurleson commentedon Jun 14, 2017
@ilkayhan - try
Splaktar commentedon Jan 17, 2018
@jonathan68 you are using AngularJS Material with Ionic 2 or Angular Material with Ionic 2? For Angular Material, you can ask questions in their forums.
sas1018 commentedon Jun 11, 2018
@ThomasBurleson can you say more about where
myAppModule.config(function($mdGestureProvider) { $mdGestureProvider.skipClickHijack(); });goes? I tried it in my main.js file but that didn't seem to work, do I need to import
angular-materiallike @thomcom said?Splaktar commentedon Jun 11, 2018
@sas1018 what exactly happened when you say "didn't seem to work"? The relevant docs can be found here: https://material.angularjs.org/latest/api/service/$mdGestureProvider