gristlabs / grist-widget

A repository of custom widgets to embed in Grist documents
https://gristlabs.github.io/grist-widget/
Apache License 2.0
54 stars 58 forks source link

Markdown exits Edit mode and autosaves on lost focus #136

Open gitterspec opened 3 weeks ago

gitterspec commented 3 weeks ago

When using the Markdown widget in Edit mode, if the focus is lost even for a second (i.e. switching to a different window), Edit mode is exited and even worse, the behavior saves (not cancels) changes.

I think the behavior should keep it in Edit mode when switching focus. It's common to need to switch focus during editing, for example: copying something from another window for pasting.

The auto-save behavior is particularly dangerous, as the original note may be inadvertently lost by accident.

dsagal commented 3 weeks ago

Cc @georgegevoian

This was done to address the need to auto-save in some cases (see https://community.getgrist.com/t/markdown-custon-widget-frustration/3768), but I agree that now it auto-saves and closes in cases when it shouldn't.