<!-- Item as a Button -->
<ion-item (click)="buttonClick()">
<ion-label>
Button Item
</ion-label>
</ion-item>
I have found that an ion-item cannot be used as a button (as documented) and is not receiving clicks when used with ion-content of a ion-menu. Only button-type things receive clicks in the side menu content.
Are you seeing this? I was porting code from Ionic2 to Ionic4 and found that this capability broke.
very useful for menu items.
I figured out the voodoo by deconstructing the default “sidemenu” project. It seems that by default, the side menu content inherited (pointer-events:none) from some Ionic class.
I created
.clickable {
pointer-events: auto !important;
}
And then set class attribute on ion-item as class=“clickable ion-activatable”
The ion-activatable gives it the nice rollover effect.
Adding the button attribute actually does not fix it as pointer events are still disabled in open menu’s. This very much seems like a bug to me. Anyway I fixed it with the following so I do not need any extra classes:
ion-item[button] {
pointer-events: auto !important;
}