YahooArchive / fluxible-router

MOVED TO FLUXIBLE REPO
104 stars 26 forks source link

window.onbeforeunload handling #68

Closed taylorjames closed 9 years ago

taylorjames commented 9 years ago

It seems a bit restricting that the NavLink window.onbeforeunload event can only be passed a string which will trigger a window.confirm('string'). I would like to handle the confirm myself with a modal instead of a window.confirm.

mridgway commented 9 years ago

I think this would be better to solve without onbeforeunload. We currently support this since it is browser behavior that is circumvented when doing client-side navigation. You could consider this a polyfill for functionality that the browser provides on HTTP navigation. We follow the same synchronous specification that the browser follows in this implementation and I think changing this behavior to be async could digress into a lot of edge cases.