Prevent navigation when clicking on workspace button

Switch from trigger to an event. Not sure why the trigger wasn' working
but this works.