My issue involves a toggle button component where I have utilized the ::before pseudo class to add text. The problem arises when clicking on the text within the toggle button causes the button's state to change. How can this be prevented?
Here is the Ionic 2 code snippet:
<ion-item>
<ion-label>some content</ion-label>
<ion-toggle (ionChange)="someMethod($event)"></ion-toggle>
</ion-item>
Associated classes :
.toggle-icon {
display: inline-block !important;
}
.item-inner {
display: block;
}
ion-toggle::before {
content: "Set as Default";
padding-left: 11%;
}
Requirement: The necessary view must be created using the above approach only.
Expected Outcome: I aim for someMethod() to be triggered upon clicking the toggle button, not the pseudo text.
Grateful for any guidance or solution provided!