Disable ripple effect on element

时光总嘲笑我的痴心妄想 提交于 2020-01-04 02:38:10

问题


I'd like to disable the ripple effect on an ion-chip element, which fires on click:

<ion-chip>
   <ion-label>Hey</ion-label>
</ion-chip>

How can I achieve this?


回答1:


<ion-chip style="pointer-events: none;" >

that will disable the styling click event in the component. Assuming you want a click event you could put a div around it.




回答2:


please try this code to remove ripple effect

ion-chip.button-effect {
     display:none !important;
    }



回答3:


The Ripple effect is only present for the Android platform as per the source code. So, as a workaround, we can change the mode to mode="ios" to avoid the effect. There seems to be no other style difference in ion-chip amongst both the platforms.

Also, this would not mess up the existing pointer-events.

<ion-chip mode="ios">
  <ion-label>Hey </ion-label>
</ion-chip>

Credits: Inspired by @rtpharry's answer to an alike question.



来源:https://stackoverflow.com/questions/55865732/disable-ripple-effect-on-element

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!