Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

when you get the form back up, the browser should fill it because it should remember the form state from earlier

alternatively, just don't browse away when you have something filled in a form - just ask the user if they meant to do that



Detecting and/or saving "something filled in a form" is hard to do with 100% accuracy across all the oddly implemented forms out there. While I feel it has slowly gotten better over the years, especially on well implemented pages, it is still a common enough issue that another solution was needed.

I do wish they had mad a user configurable flag rather than forcing people to use plugins to re-acquire functionality they had before.


I'm not sure why it'd be hard. "If there's a dom element that's an input of any time, and the user has focused it at any point, ask for confirmation on page exit" would work fine. The only case where I can see it being an issue would be a site that uses a select element as a menu, but I've not seen any do that in years.


I think it can easily get abused, just some hidden focused inputs


Browsers already have a pageUnload event that can block a user leaving until they confirm they want to. This would effectively be the same.


Or maybe like just disable it if there is something to lose ie there is a form and I entered something in it with the keyboard


That would be worse. Then the expected behavior (that backspace would navigate back) wouldn't occur because I'm filling in this form. Even though I've left the field (so backspace is captured by the tab and not the form field) and have decided to abandon the comment and go back to reading the thread.


you can just say "Cancel" or "Navigate away" in the dialog that comes up

if you have written a long paragraph it shouldn't just be lost because you accidentally pressed a key on your keyboard




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: