codedance / jquery.AreYouSure

A light-weight jQuery "dirty forms" Plugin - it monitors html forms and alerts users to unsaved changes if they attempt to close the browser or navigate away from the page. (Are you sure?)
508 stars 145 forks source link

Clicking fast on the same link after pressing "stay" with not trigger the alert anymore #136

Open kushtra24 opened 6 years ago

kushtra24 commented 6 years ago

After I click a button or close and the alert pups-up, I press "stay" than immediately press the same button the alert does not pop-up anymore. and the browser let's me leave without any alert.

But if I wait for a second or two then the alert works again.

Moggieggwp commented 6 years ago

Yeah, I had the same issue, it's because there is a delay 900 milliseconds, window.setTimeout(function () { window.aysHasPrompted = false; }, 900); So you can manually change it to 0 and that's ok