All overflow related websites ask "Are you sure you want to navigate away from this page" etc. etc. any time I try to leave a page after beginning a comment or answer - even if I have deleted ALL text in the input boxes after changing my mind. This is a small thing, but always bothers me. Should it be fixed?
What is meta?
- Any Stack Exchange user can ask a question
- The community provides support, votes on ideas, and reports bugs
- Your voice helps shape the way Stack Exchange operates
It looks like SO attaches a listener for "beforeunload" event only after you start writing in a textarea. All that needs to be done here is check for a textarea value in that
Could be easily changed to:
It's a browser thing. For example opera does not do this. Since it doesn't fire
So it would require a check of the data within whatever box was filled (which can by many, since there are comment boxes also). Which might be the reason for this.
Could/should it be fixed? Sure.