How to remove click effect of an ion-item

非 Y 不嫁゛ 提交于 2019-12-25 00:23:56

问题


I want to remove click effect of an ion-item.I used --background-activated and --ripple-color but nothing happend.

.no-click{
--background-activated: transparent;
--ripple-color: transparent;
}

<ion-item class="no-click">
<ion-avatar slot="start">
<img [src]="img">
</ion-avatar>
<ion-label>{{name}}</ion-label>
</ion-item>

How can i remove click effect of an ion-item?


回答1:


Simply give pointer-events:none css to disable click.

 .no-click {
   pointer-events:none; //This makes it not clickable
 }


<ion-item class="no-click">
    <ion-avatar slot="start">
        <img [src]="img">
        </ion-avatar>
     <ion-label>{{name}}</ion-label>
  </ion-item>


来源:https://stackoverflow.com/questions/57751394/how-to-remove-click-effect-of-an-ion-item

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