tneotia / html-editor-enhanced

A Flutter package that provides a WYSIWYG editor backed by flutter_inappwebview and the Summernote library.
https://pub.dev/packages/html_editor_enhanced
MIT License
269 stars 318 forks source link

Uncaught TypeError: Cannot read property 'insertBefore' of null #481

Open AliEasy opened 7 months ago

AliEasy commented 7 months ago

Describe the bug By using below code make text rtl according to this link

_bodyController.editorController!.evaluateJavascript(
                    source: "\$('div.note-editable').attr('dir', 'rtl');");

after using controller.insertText('sth') below error occurs: Uncaught TypeError: Cannot read property 'insertBefore' of null

To Reproduce 1- Add below code to HtmlEditor:

callbacks: Callbacks(
              onInit: () {
                _bodyController.editorController!.evaluateJavascript(
                    source: "\$('div.note-editable').attr('dir', 'rtl');");
              },
            ),

2- Use blow code to add some text at button onPressed(): controller.insertText('[#نام شرکت#]'); 3- Click on button multi times

vadrian89 commented 6 months ago

Since the editor wasn't updated in a while, I think it's related to: https://github.com/summernote/summernote/issues/3257

I am working on an update for the package, but since the original developer doesn't seem to be active for quite a while now, I think I will upload the package myself on pub.dev

vadrian89 commented 6 months ago

Can you try html_editor_plus and see if still persists?