deck icon indicating copy to clipboard operation
deck copied to clipboard

Autosave a card description on page reload

Open matchish opened this issue 4 years ago • 7 comments

Describe the bug When you edit a card and then without pause reload the page the modifications are lost

Expected behavior The card description have to be saved before page reload

Server details

Nextcloud version: 18.0.4

List of activated apps:

Enabled:

  • accessibility: 1.4.0
  • bruteforcesettings: 1.5.0
  • calendar: 2.0.2
  • cloud_federation_api: 1.1.0
  • comments: 1.8.0
  • contacts: 3.2.0
  • dav: 1.14.0
  • deck: 1.0.5
  • federatedfilesharing: 1.8.0
  • federation: 1.8.0
  • files: 1.13.1
  • files_sharing: 1.10.1
  • files_trashbin: 1.8.0
  • files_versions: 1.11.0
  • logreader: 2.3.0
  • lookup_server_connector: 1.6.0
  • mail: 1.1.3
  • oauth2: 1.6.0
  • onlyoffice: 4.1.4
  • password_policy: 1.9.0
  • provisioning_api: 1.8.0
  • settings: 1.0.0
  • sharebymail: 1.8.0
  • spreed: 8.0.8
  • systemtags: 1.8.0
  • theming: 1.9.0
  • twofactor_backupcodes: 1.7.0
  • updatenotification: 1.8.0
  • workflowengine: 2.0.0 Disabled:
  • admin_audit
  • defaultgroup
  • encryption
  • files_external
  • occweb
  • testing
  • user_ldap

matchish avatar Aug 07 '20 07:08 matchish

One could use localStorage or sessionStorage.

I would prefer the latter for security and privacy reasons (in case of multiple people using thr same device).

@matchish do you want to provide a Pull Request? 🚀 🙂


This approach might also be used to the comments field.

stefan-niedermann avatar Aug 10 '20 09:08 stefan-niedermann

Browsers are quite limiting on actions that can be performed if a page is closed or reloaded, so the only thing we could do here is probably to block navigating away with an confirmation dialog.

juliusknorr avatar Aug 19 '20 20:08 juliusknorr

@juliushaertl Could you give me a hint how to recognize a page close/reload?

jakobroehrl avatar Dec 30 '20 12:12 jakobroehrl

https://developer.mozilla.org/en-US/docs/Web/API/WindowEventHandlers/onbeforeunload

juliusknorr avatar Jan 05 '21 21:01 juliusknorr

Another thing I noticed today is, that if you have the edit dialog open (modal or sidebar, does not matter), paste some text into the description and click anywhere else than the edit dialog (such that the modal/sidebar closes), the content is lost. I would appreciate a "save on exit" in those instances!

reox avatar Jul 03 '23 07:07 reox

Been having this same issue. I wouldn't mind having somekind of force-save button or whatever.

The only way to get descriptions save for me is to:

  1. type description
  2. click outside of description
  3. edit the title
  4. save title

Also sometimes editing description twice works. But it's very unreliable.

Akselmo avatar Dec 11 '23 08:12 Akselmo

I have similar issues, where the automatic saving of the description field is not always triggered (or it doesn't always succeed). See #5628.

While it is not easy to track down all possible ways of losing the entered information, one simple check it should be done when navigating away, but also when simply closing the card edit window, so that if save didn't happen, prevent any further action that would cause loss of entered data.

fferri avatar Feb 29 '24 14:02 fferri