question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Crashes when using 'indent' or 'outdent' buttons directly

See original GitHub issue

steps to reproduce

  1. Include one toolbar item such as ['para', ['ul', 'ol', 'indent', 'outdent']], for example.
  2. Attempt to initialize using, in my case $('.rich-edit').summernote(...).
  3. The editor partially sets up, but doesn’t complete, leaving the textarea visible and missing some toolbar buttons.

browser version and os version

Browser: Google Chrome 56.0.2924.76 (64-bit) O/S: Linux 4.2.0-0.bpo.1-amd64 #1 SMP Debian 4.2.6-3~bpo8+2 (2015-12-14) x86_64 GNU/Linux

Console error obtained:

Uncaught TypeError: o.append is not a function
  at Renderer.render (http://localhost:1084/client.js:8:1854)
...
summernote.js:1839
...

This corresponds to src/js/base/renderer.js line 39 in version 0.8.2 (latest on NPM):

  if ($parent) {
    $parent.append($node);
  }

Using paragraph works fine, this is only when I try to use indent and outdent directly (with or without paragraph also present). I read #1576 and the associated commits, but cannot understand what’s happening at this level. It seems it may have worked in 0.7.2 and regressed at some point since.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:4
  • Comments:8 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
electricmessiahcommented, Apr 27, 2021

why is this closed? I have the exact same problem. it’s not jquery. it’s the use of [‘para’, [‘ul’, ‘ol’, ‘indent’, ‘outdent’]] that bugs it out.

1reaction
niceman-zzcommented, Sep 6, 2018

I faced this issue too. I’ve fixed it by just adding a check into Renderer.prototype.render if $parent is a jQuery object. I’m not sure if it’s correct or not but it works for me. Here it is at the end of the method:

    Renderer.prototype.render = function ($parent) {
        var $node = $$1(this.markup);
        <...>
        // added check for jQuery object
        if ($parent && $parent instanceof jQuery) {
            $parent.append($node);
        }
        return $node;
    };

The only problem was with attaching this fixed code as we use Node.js and pull this from NPM repo. Fortunately it was found out that we have local NPM registry in our company so I just used it to download fixed code and set our artifactory as default NPM registry.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Crashing Word using Indent - Google Groups
I am using Office 97 Pro on Win 98 SE. When I try to use the Indent Button (or Ctrl-M) to increase indent...
Read more >
My task won't indent or outdent. What's happening?
You may be working in a view that doesn't use the outline buttons The Indent and Outdent buttons work only when the Gantt...
Read more >
Fixed issues in Dreamweaver releases - Adobe Support
Trying to install Adobe Dreamweaver, installation fails with error code ... Indent/outdent code not honoring the indent size and Tab spaces ...
Read more >
Ability to Indent block elements such as paragraphs, headings ...
I have no indent/outdent buttons, enabled or not. (Philip–I agree with all of the comments above about reversing the decision to remove indenting....
Read more >
Updates - Imperavi
Fixed: A button added with the plugin takes an incorrect position if it was ... Fixed: The issue with indent/outdent when the editor...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found