Issue #8013 open

Warn before allowing navigation away from a page with text in forms (BB-9183)

Kartik Agaram
created an issue

Try typing in some text into a textarea on bitbucket. Say this 'create issue' form ( or a comment form on a commit. Type in a few lines.

a) Navigate away by clicking on a link or hitting the 'back' button. The user should be warned that they have unsaved changes.

b) Return to the page with the form. The contents typed in are missing.

Both these behaviors would work for free on any modern browser if you just used a simple textarea.


Data loss is a huge problem when it happens. It stifles long-form conversation. It's worth being conservative to avoid.

I remember when browser textareas used to eat my comments all the time. It took 10 years, but they're rock solid now. I've literally had my laptop battery die on me mid-sentence, booted up, restarted my browser, and there's my half-written comment right there.

This was extremely hard-won knowledge, but more and more sites seem to be reinventing the wheel without realizing the regressions they're introducing. Please, stop using markitdown or whatever fancy javascript editor you're using. This is a site for hackers, and having to write markdown by hand isn't a huge hardship for us.

At the very least, provide a mode that's a simple textarea that doesn't prevent the browser from saving its contents.