Flow Router prompt before leaving page


#1

Hi,

I would like to know if it was possible to prompt the user when leaving a page, like “Are you sure you want to leave this page ?” threw Flow Router.
I saw it was possible with Iron-Router, but found nothing on flowrouter.

If anyone has succeed in doing this kind of thing please help me :slight_smile:
Thanks a lot


#2

You can add a function to "triggersExit"


But I haven’t looked at how to stop FlowRouter in case the user says no. Probably possible though.


#3

Hi,

Yes, I know about triggersExit, but when it enters triggersExit, it has already left the page and already went to the next route, so it doesn’t do what I except.


#4

Seems that space-alien’s solution might be the best so far.