Uploaded image for project: 'Moodle app'
  1. Moodle app
  2. MOBILE-2896

Enable use of core-rich-text-editor within plugins

    XMLWordPrintable

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Not a bug
    • 3.6.0
    • None
    • Rich Text Editor
    • MOODLE_36_STABLE

    Description

      Currently the core-rich-text-editor is really only available within core components because it relies on being provided with a FormControl object. Plugins using the CoreCompileHtmlFakeComponent do not have access to a FormControl object.

      However I have managed to use the rich text editor in a plugin by leaving out the control object. In my template I just use:

      <core-rich-text-editor item-content placeholder="<% placeholder %>"></core-rich-text-editor>

      The issue now is that there is an error in the console about not being able to get value from undefined in this.control.value on line 94 of rich-text-editor.ts. Because I have used my own methods to cope with data and changes in the rich text editor, other than these quite reasonable errors in the console, the editor works perfectly.

      To remove these errors, so allow those like myself who would like to use the rich text editor in a plugin, I have created a simple patch. This is really just a hack that prevents the editor trying to use a FormControl where one does not exist, so is not a good long term solution, but would help in the short term.

       

      Attachments

        Activity

          People

            jleyva Juan Leyva
            jb23347 John Beedell
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: