Fix issue with previous commit: only prevent default event if it's a navigation event