deck
deck copied to clipboard
Autosave a card description on page reload
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
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.
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.
@juliushaertl Could you give me a hint how to recognize a page close/reload?
https://developer.mozilla.org/en-US/docs/Web/API/WindowEventHandlers/onbeforeunload
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!
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:
- type description
- click outside of description
- edit the title
- save title
Also sometimes editing description twice works. But it's very unreliable.
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.