For some reason on iOS having an icon in a button doesn’t trigger the click event if the icon is tapped. For android it works. If you tap the button background (not icon) it triggers the event.
<button ion-button (click)="toggleSearch()" *ngIf="!showSearchBar">
<ion-icon name="search" color="primary"></ion-icon>
Should I just add (click)=“function()” to the icon as well?
Actually the clickable region for buttons on iOS is all over the place (mainly the top and bottom of the button works).
I thought it was only the icons but it takes many tries to actually click the button.
I tried with an actual device and emulators, with the emulate it is easy to tell where I click and I have to click in random places (like upper left part of button) for it to actually work.
Also I have the most success when I press the button for a half second or more. If I just tap/click it will not register.
With the web inspector I deleted most of the elements on the page except for the header and one button. And I also deleted the buttons interior elements (:after, hover-effects…).
And still I can only click some edges of the button to trigger the click event. If I try to click the interior (center) nothing happens.