UI spellcheck is not working after a task with disabled spellcheck was opened

XMLWordPrintable

    • High
    • Spellcheck remained disabled for other tasks after opening one task where spellcheck was explicitly disabled with liveCheckOnEditing config.

      problem

      1. Open a task liveCheckOnEditing = 0
      2. Change to a task where liveCheckOnEditing = 1
      3. The spellcheck will still not work

      reason

      The reason for this behaviour is a logical bug in the spellcheck controller: 

      /***
       * After task config load event handler.
       */
      onEditorConfigLoaded:function(app, task){
          var me=this,
              isPluginActive = app.getTaskConfig('plugins.SpellCheck.liveCheckOnEditing');
          me.setActive(isPluginActive);
      },

       

      1. The above event handler is evaluating the tasks config.
      2. If liveCheckOnEditing in a task is disabled, this disables the whole controller
      3. After changing to another task - where liveCheckOnEditing is enabled - the event handler onEditorConfigLoaded is never called again since the whole controller is deactivated

      Conclusion

      deactivating of a controller is a useful way to disable a controller / feature but can not be controlled from inside the controller.

      Solution

      spellcheck disabling must be implemented via an internal deactivation flag instead of deactivating the whole controller

            Assignee:
            Aleksandar Mitrev
            Reporter:
            Thomas Lauria
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: