Skip to content

CKEditor not firing dirty and clean events #132

Description

@StuffOfInterest

I recently implemented DirtyForms with both the CKEditor and Bootstrap plugins. The dirty state tracking and dialog intercepts seem to be working (although it will on occasion not catch the back button). The main problem I'm seeing is that CKEditor is not firing the dirty and clean events. I implemented the code below from the documentation so enable and disable buttons based on dirty state:

$('form').find('[type="reset"],[type="submit"]').attr('disabled', 'disabled');
$('form').on('dirty.dirtyforms clean.dirtyforms', function (ev) {
    var $form = $(ev.target);
    var $submitResetButtons = $form.find('[type="reset"],[type="submit"]');
    if (ev.type === 'dirty') {
        $submitResetButtons.removeAttr('disabled');
    } else {
        $submitResetButtons.attr('disabled', 'disabled');
    }
});

For the text box controls on the page the submit and reset buttons are being disabled and enabled based on the state. Unfortunately, making changes in the CKEditor input has no effect. CKEditor is changing the dirty flag because if I make any edits in that box the dialog will popup when I try to navigate off page.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions