We have a web application that includes two internal tabs (within the webpage). One of which the user writes down comments, and the other where they only view content. There are times where they have two browser windows open. One to view the comment and a Second to view the content at the same time.

There have been times where the user will click back into the comments tab from the 2nd browser window, and then the autosave will kick in and delete all of their information.

Any ideas on what is the best practice for a situation like this?

  • 1
    This seems more like an implementation question, but nevertheless it is unclear what you are asking. Could you explain what happens better? Does the user has two comment tabs open and when clicking back on one, the it saves empty comment? – Izhaki Oct 19 '15 at 23:56

This is a problem that you can easily replicate in online mail services that provides autosaves.

For example, in Gmail, if you save a draft email in window A, and open up the same draft email in window B and make changes to it, then you will see that there are two draft emails in the Draft Folder. No work is lost.

That's the safe route, and you should probably take the same approach.

In your case, there is no "draft folder" per se, but you can still display a modal window alerting the user that there are two drafts, and provide a mechanism for viewing two versions in the modal window, and pick the one they like.


One solution is simply don't auto-save. Only save content when the user intentionally chooses to do so.

On the web, auto-save functionality is not expected. Users typically expect to lose form information if they have not saved it.

Auto-save can be a nice feature when the situation calls for it, but you should only do when there is clear benefit and it doesn't add unnecessary complexity. The benefit generally comes with very complex forms or content editing (such as a CMS or email program), where the user is likely to be working on the content for a long time (without saving) and may leave and come back. For more standard forms and short content, it is unlikely to be very beneficial.

You need to implement something fairly complicated to handle this right (such as the suggestion by Jung Lee). Even then, if having two windows open is a common occurrence, the solution is likely to be unwieldy and confusing to users. The user will not expect auto-save to happen in a window they have only opened for viewing, and it will be annoying to have to decide between versions all the time.

In the absence of an auto-save feature, you could have a modal dialog warn the user if they are leaving a page with unsaved changes (as many sites, including Stack Exchange, do).

Another option to consider is opening pages for viewing only by default, and requiring an extra step to edit the content. This wouldn't eliminate the scenario, but it would make it rarer.

Not the answer you're looking for? Browse other questions tagged or ask your own question.