🏠 back to Observable

bug: page navigates away with unsaved changes in a text box

#1

While typing a long function in a cell, I somehow got my copy of Firefox here to interpret the backspace key as page navigation before my typing had been committed. The browser navigated back in history, leaving the page. When I went forward again to return to my notebook, my typing was lost.

This reminded me that I need to disable the moronic default backspace behavior in my Firefox here, but there is also an Observable bug here (which I have run into a couple of other times for other reasons, but can’t really remember the details) causing data loss.

If there is something typed in a cell but the cell has not yet been run / saved, the notebook page should put up a modal prompt before letting the browser navigate away. This won’t show up too often (because most of the time the content of all of the cells is committed) so it shouldn’t ever bother anyone. But could save someone from disaster if they for whatever reason do a ton of typing without committing partial results along the way.

3 Likes
#2

Same here. But I usually refresh my browser because of some mistakes that is impossible to be cleaned up. Keeping in mind to hit Shift+Enter after each change I made, I rarely lose my work by accident. I see this issue a feature more than a bug: at least it is a way to quickly discard the change of the current cell (should be implemented as a separate button, though).

1 Like
#3

Ah, that’s an interesting one.

The escape key currently closes the current cell and commits the changes, but it might be nice to have some shortcut for “discard the current typing”.

2 Likes