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-list-item ripple + Iphone/android user agent #5261
On Android (chrome 43) this seems to happen with every thing that can ripple.
This issue coupled with the fact that the ripple service was using mousedown (which causes issues for blackberry 10's browser) caused me to come up with a not so pretty work around until this all gets officially sorted out.
InkRippleCtrl add a delay variable, inject $mdGesture and register press events
functionInkRippleCtrl($scope,$element,rippleOptions,$window,$timeout,$mdUtil,$mdGesture){this.$window=$window;this.$timeout=$timeout;this.$mdUtil=$mdUtil;this.$scope=$scope;this.$element=$element;this.options=rippleOptions;this.mousedown=false;this.ripples=[];this.timeout=null;// Stores a reference to the most-recent ripple timeoutthis.lastRipple=null;this.rippleDelay=100;$mdUtil.valueOnUse(this,'container',this.createContainer);$mdUtil.valueOnUse(this,'background',this.getColor,0.5);this.color=this.getColor(1);this.$element.addClass('md-ink-ripple');// attach method for unit tests($element.controller('mdInkRipple')||{}).createRipple=angular.bind(this,this.createRipple);($element.controller('mdInkRipple')||{}).setColor=angular.bind(this,this.setColor);$mdGesture.register($element,'press');this.bindEvents();}
Bind events we bind mousedown to $md.pressdown. This solves the mousedown issue for blackberry, but breaks the ripple size since we no longer have layerX and layerY (apparently they are non-standard?)
This seems gross, but I changed handlemousedown to have a short delay before firing the ripple. This way we don't light up every single list item with a ripple.
InkRippleCtrl.prototype.handleMousedown=function(event){if(this.mousedown)return;this.setColor(window.getComputedStyle(this.$element[0])['color']);// When jQuery is loaded, we have to get the original eventif(event.hasOwnProperty('originalEvent'))event=event.originalEvent;this.mousedown=true;this.$timeout(angular.bind(this,function(){if(this.mousedown){if(this.options.center){this.createRipple(this.container.prop('clientWidth')/2,this.container.prop('clientWidth')/2);}else{this.createRipple(event.pointer.x,event.pointer.y);}}}),this.rippleDelay);};
Last fix the create ripple calculation. I assume a good chunk of why mousedown and layerX/Y were used was to avoid the call to getBoundingClientRect?
if you downgrade to 0.11.4 this does not exist, but then i get an issue where md-select items auto close on the iPhone so i can't use 0.11.4. I ended up adding md-no-ink to the elements in the meantime.
+1 same issue, touch down registers and shows the ripple but if I'm scrolling the menu then the up event doesn't happen on the button itself and the ripple darkening doesn't clear. This can be seen in the menu on the angular-material demo/docs site as well.
Activity
mckenzielong commentedon Oct 21, 2015
On Android (chrome 43) this seems to happen with every thing that can ripple.
This issue coupled with the fact that the ripple service was using mousedown (which causes issues for blackberry 10's browser) caused me to come up with a not so pretty work around until this all gets officially sorted out.
InkRippleCtrl add a delay variable, inject $mdGesture and register press events
Bind events we bind mousedown to $md.pressdown. This solves the mousedown issue for blackberry, but breaks the ripple size since we no longer have layerX and layerY (apparently they are non-standard?)
This seems gross, but I changed handlemousedown to have a short delay before firing the ripple. This way we don't light up every single list item with a ripple.
Last fix the create ripple calculation. I assume a good chunk of why mousedown and layerX/Y were used was to avoid the call to getBoundingClientRect?
PostImpatica commentedon Oct 29, 2015
if you downgrade to 0.11.4 this does not exist, but then i get an issue where md-select items auto close on the iPhone so i can't use 0.11.4. I ended up adding md-no-ink to the elements in the meantime.
shusain commentedon Oct 29, 2015
+1 same issue, touch down registers and shows the ripple but if I'm scrolling the menu then the up event doesn't happen on the button itself and the ripple darkening doesn't clear. This can be seen in the menu on the angular-material demo/docs site as well.
lukabers commentedon Oct 30, 2015
+1 same issue
jpike88 commentedon Nov 3, 2015
This is a serious flaw, any app made using buttons is going to look like crap and confuse the hell out users.
fix(ripple): removing ripples on touchmove
fix(ripple): removing ripples on touchmove
jpike88 commentedon Nov 5, 2015
awesome work guys
performance(remove $watch from menuController)