Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-51597

TinyMCE in IE11 displays "Are you sure you want to leave this page?" message when no form values have been changed

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 2.8.6
    • Fix Version/s: None
    • Component/s: HTML Editor (TinyMCE)
    • Labels:
      None
    • Affected Branches:
      MOODLE_28_STABLE
    • Workaround:
      Hide

      Use Atto as the default editor or don't use IE 11.

      Show
      Use Atto as the default editor or don't use IE 11.
    • Testing Instructions:
      Hide
      1. Ensure that TinyMCE is the default editor for the site
      2. Use IE 11 as the browser
      3. In a course, click add an activity, choose "Assignment" and before filling in any fields in the form click on a link in the navigation bread crumb (e.g. the course link)

      Expected result: The browser window navigates to the link that was clicked
      Actual result: A dialog box pops up with the "Are you sure you want to leave?" message.

      Show
      Ensure that TinyMCE is the default editor for the site Use IE 11 as the browser In a course, click add an activity, choose "Assignment" and before filling in any fields in the form click on a link in the navigation bread crumb (e.g. the course link) Expected result: The browser window navigates to the link that was clicked Actual result: A dialog box pops up with the "Are you sure you want to leave?" message.

      Description

      When using TinyMCE as the default editor and using IE11 as your browser (tested in Windows 7), if you navigate away from a page using a link the "Are you sure you want to leave this page?" message is displayed even if no changes have been made to the editor or any other part of the form.

      I spent some time stepping through formchangechecker with a Javascript debugger and found that the message was being displayed because the TinyMCE editor isDirty() method was returning true

      Digging a little bit more into the isDirty() method I found that there is some IE specific code that seemed to be causing the issue when I stepped through it with the debugger. Somehow the starting content did not have this applied to it, but the current content did (starting and current content as applied in the isDirty() method) and so TinyMCE sees the editor as changed.

      It should be noted that this is not experienced in Chrome.

        Attachments

          Activity

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            sbc24 Sam Chaffee
            Participants:
            Component watchers:
            Andrew Lyons, Dongsheng Cai, Huong Nguyen, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated: