summernote icon indicating copy to clipboard operation
summernote copied to clipboard

PLUGINS: Uncaught Error: TOOLTIP: Option "container" provided type "undefined" but expected type "(string|element|boolean)".

Open KarmicXKoala opened this issue 8 years ago • 6 comments

steps to reproduce

  1. Include summernote
  2. Include plugin: specialchars
  3. Add specialchars to toolbar

browser version and os version and summernote version

OS: OSX High Sierra Browser: Chrome 64.0.3282.186 (Official Build) (64-bit) Summernote: 0.8.10 (bs4)

When attempting to use the specialchars plugin, I get the error in the Issue title, and the button doesn't render. Looking at the code, it appears that this plugin (and the others included) is calling ui.button incorrectly. Changing the block at line 67 to read

context.memo('button.specialchars', function() {
    return ui.button(
        $,
        {
            container: options.container,
            contents: '<i class="fa fa-font fa-flip-vertical">',
            tooltip: lang.specialChar.specialChar,
            click: function() {
                self.show();
            }
        }
    ).render();
});

After this, the plugin appears to work, but does provide another error: No method named "destroy". Changing (after the above changes) line 301 to read

self.$dialog.find('button').tooltip('hide');

appears to resolve this as well.

The reasons I don't simply submit a pull request are that

  • I don't have a tremendous understanding of this repo, as I just started using it
  • I don't know how to unit-test javascript
  • I can't guarantee that nothing else breaks

KarmicXKoala avatar Mar 15 '18 14:03 KarmicXKoala

I am facing same problem. Can anyone solve this issue?

rarobi avatar Mar 29 '18 16:03 rarobi

Same here...

kjdion84 avatar Apr 01 '18 09:04 kjdion84

Found this issue from googling the error message - not a summernote user.

I was upgrading my project to bootstrap 4.1.0 from 4.0.0-beta2. Bootstrap uses a library called Popper, which is what is throwing the error. This was caused in my project because I wasn't providing a title to a popover.

Try adding a "title" property to that object you're passing to ui.button() (ie. as a sibling to "tooltip", "contents", etc.)

shorn avatar Apr 12 '18 10:04 shorn

var button = ui.button({
                                contents: '<i class="fa fa-child"/> Hello',
                                container: false,  //add option
                                tooltip: 'hello',
                                click: function () {
                                    // invoke insertText method with 'hello' on editor module.
                                    context.invoke('editor.insertText', 'hello');
                                }
                            });

woleicom avatar Apr 28 '18 05:04 woleicom

@KarmicXKoala try set title like this ({ title: lang.specialChar.specialChar || '' })

KarolMilewski avatar May 15 '18 20:05 KarolMilewski

I had the same problem. Adding container: false to the object for ui.button() fixed it.

julianpoemp avatar May 16 '18 21:05 julianpoemp