Opened 23 months ago

Last modified 18 months ago

#18048 new defect (bug)

Ctrl+S draft save causes prompt on exit

Reported by: jakub.tyrcha Owned by:
Priority: normal Milestone: Awaiting Review
Component: Administration Version:
Severity: normal Keywords: has-patch close
Cc: ryan@…

Description

When you use the "save draft" button and leave the edit page, the "unsaved changes" prompt doesn't show up. However, when you save using Ctrl+S and leave - the prompt appears.

Attachments (1)

18048.diff (523 bytes) - added by solarissmoke 21 months ago.
Change dirtiness flag in rich editor on autosave

Download all attachments as: .zip

Change History (6)

  • Cc ryan@… added

I'm not aware of a keyboard shortcut that saves anything. I could be wrong, but I don't believe there is one.

In that case, the prompt is appearing because nothing has been saved. Because the shortcut didn't do anything.

Not true. There is a shortcut and as far as my research goes, it does save the content.

Ctrl+S forces an autosave (which is JS driven) so it doesn't reset the browser's internal "textarea content has changed". This is only reset on form submit.

Change dirtiness flag in rich editor on autosave

  • Keywords has-patch added; needs-patch removed

TinyMCE has a flag that we can use to override its internal dirtiness check when autosaving, see 18048.diff. This fixes the issue for me but probably needs someone more familiar with the JS to make sure it doesn't do anything unintended.

  • Keywords close added

Autosave doesn't save everything. You still need to press Save for the good stuff.

Note: See TracTickets for help on using tickets.