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.

Creating Custom toolbar button with tooltip issue

See original GitHub issue

Thank you a lot for helpful and important plugin.

steps to reproduce

  1. create normal html div or textarea tags.
  2. create a summernote instance with custom button as described in the official documentation.
  3. The issues arise in editor body scroll and when you press fullscreen something calculated wrongly for the editor body.

browser version and os version and summernote version

What is your browser and OS? windows 7 windows 10 chrome explorer 11 What is your summernote version? 0.8.9

screenshot of issue

The following jsfiddle could reproduce the issues (commenting tooltip: 'hello', will solve the issue, but make the custom button without tooltip): https://jsfiddle.net/javatmp/8fm5vq50/

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:5
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

10reactions
alegoutcommented, Mar 11, 2018

Nice work @DiemenDesign ! Love it 😃

I looked a the code, the problem is in summernote-bs4.js @ line 218:

 button: function ($node, options) {
     return renderer.create('<button type="button" class="note-btn btn btn-light btn-sm" role="button" tabindex="-1">', function ($node, options) {
         if (options && options.tooltip) {
             $node.attr({
                 title: options.tooltip,
                 'aria-label': options.tooltip
             }).tooltip({
                 container: options.container,
                 trigger: 'hover',
                 placement: 'bottom'
             });
         }
     })($node, options);
 }, 

options.container is not defined, maybe we could test it in the if.

@JavaTMP a temp fix in your custom summernote plugin is to add this option in your ui.button call:

container: ‘body’,

Example:

    let button = ui.button({
        className: 'note-btn-bold',
        contents: '<i class="fa fa-file-text-o">',
        container: 'body',
        tooltip: lang.linkContents.buttons.chooseContents,
       # others options...
    });

Work for me, hope it helps.

Thanks again for summernote, it rocks! 👍

0reactions
filipheymanscommented, Apr 25, 2018

Seems like the container option is made configurable since 7b497639c468a19702b6b8725122e9ba540434e5.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to add tooltips for toolbar buttons? - Flexmonster
Hi Dear Team, Is there a way to add tooltips for the buttons of toolbar(please see the attached screenshot)?
Read more >
Adding a Tooltip for Custom Toolbar Buttons
Hi, so I created a custom toolbar using a MadCap Flare tutorial (below) and added a custom button. When I publish the project,...
Read more >
Creating custom Basic toolbar buttons - TinyMCE
Name of the icon to be displayed. Must correspond to an icon: in the icon pack, in a custom icon pack, or added...
Read more >
ExtJS toolbar button tooltip does not seem to respond to settings
In order to avoid this behavior, I've been trying make the tooltip appear just over the button. At first this seemed simple, because...
Read more >
How to add tooltip to the grid toolbar and grid row action button
I cannot add a tooltip to both a toolbar button and a action button located in the grid row. Please look at my...
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