id summary reporter owner description type status priority milestone component version severity resolution keywords cc focuses
22266 onbeforeunload alert always triggers with attachments duck_ koopersmith "'''Steps'''
1. Create a post with attachments in it
1. Visit the post's edit screen
1. Navigate away without modification and see an alert about ""The changes you made will be lost...""
Trying to press ""Update"" and then leaving gives the same result.
'''Cause'''
`tinymce.activeEditor.isDirty()` is always returning true because attachments are lazy loaded with individual XHRs and so the editor's `startContent` property doesn't contain the full HTML for an attachment. Once an attachment model has been loaded then it's re-rendered and the editor content is different even though the user hasn't made any modifications.
Related: #21390, #21813, [22012]" defect (bug) closed low 3.5 Media 3.5 blocker fixed