I have a Material UI Switch Component where I would like to detect click events on and be able, in certain circumstances, to prevent the change event from firing.
What would be the best way to do this?
I've used event.preventDefault to prevent events from bubbling up to parent component event listeners before, but in this case I have two events on the same Component/element and I want one to fire before the other and potentially prevent the other from firing.
Here's a codePen of what I've tried.