Fix #269 by popping up dialog when user tries to navigate away