I had this a couple of times yesterday but hadn't paid attention to the why and how. It just happened again a few mins back where I posted a reply and the 'Do you want to leave this page? Any unsaved content may be lost' message box appeared after I'd clicked 'Post quick reply'. Clicking 'Yes' posts the reply.
This was on Firefox 7.0.1