bootstrap-hover-dropdown icon indicating copy to clipboard operation
bootstrap-hover-dropdown copied to clipboard

doesnt work with only img tag inside dropdown-togggle link

Open Hortt opened this issue 9 years ago • 5 comments

here is the layout:

<div class="visitor_tab">
    <a href="#" id="user_icon" class=" " data-toggle="dropdown" data-hover="dropdown" aria-expanded="false">
        <img alt="" src="http://0.gravatar.com/avatar/f1cb99d9aba841d2121d3a42b4e7a6ac?s=36&amp;d=mm&amp;r=g" srcset="http://0.gravatar.com/avatar/f1cb99d9aba841d2121d3a42b4e7a6ac?s=72&amp;d=mm&amp;r=g 2x" class="avatar avatar-36 photo" height="36" width="36">                                
    </a>
    <ul class="dropdown-menu" role="menu">
        <li role="presentation">
            <a role="menuitem" tabindex="-1" href="#">Watch Later</a>
        </li>
        <li role="presentation">
            <a role="menuitem" tabindex="-1" href="#">Latest</a>
        </li>
        <li role="presentation">
            <a role="menuitem" tabindex="-1" href="#">Recomended</a>
        </li>
    </ul>
</div>

Hortt avatar Nov 09 '15 20:11 Hortt

What browsers are you seeing this problem in?

jmartin84 avatar Nov 09 '15 20:11 jmartin84

@Hortt You can't just paste arbitrary markup in here if you're trying to show the code. I fixed it this time, but it may be a good idea to familiarize yourself with Mastering Markdown

CWSpear avatar Nov 09 '15 22:11 CWSpear

@CWSpear, Ah, thank you! @jmartin84 Windows Chrome v46.0.2490.80 m

Hortt avatar Nov 10 '15 13:11 Hortt

I also get the same when an empty DIV is added. The div has size and abckground image, but no content and this makes the menu not triggering. I guess this is because you assume the dropdown link can't have hoverable children, but that's not the case in most of the cases, when you decorate a menu with images for example.

lllopo avatar Mar 29 '16 07:03 lllopo

Changing line 50 to : if(!$parent.hasClass('open') && !$this.is(event.target) && !$.contains($this[0], event.target)) {

solved it for me, but not sure if it won't caause other issues. Needs a check by someone more into this.

lllopo avatar Mar 29 '16 08:03 lllopo