Custom Content Type Giving me "Leave Page" warning

I am working on a new Custom Content Type. For some reason, when I edit the contents and click Commit I get the javascript error that I normally get when trying to navigate away from the page, but this isn't the case, I am just trying to save:

 

 

Is there something that I have missed in my code that prevents that? Or that makes the page know that I am not trying to navigate away, but only saving?

Come on Matrix devs, don't leave me hanging....

Hi Nic,

You'll need to add and "else if" block for your event to core/lib/js/state.js::saveState()

If you look at the code you'll see that fair few events are being skipped (like context changer) to make sure Matrix doesn't see this event as a change and then warn about the unsaved changes.

 

HTH.

 

Ash