Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doesnt work with only img tag inside dropdown-togggle link #134

Open
Hortt opened this issue Nov 9, 2015 · 5 comments
Open

doesnt work with only img tag inside dropdown-togggle link #134

Hortt opened this issue Nov 9, 2015 · 5 comments

Comments

@Hortt
Copy link

Hortt commented Nov 9, 2015

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 Hortt changed the title doesnt work with onli img tag inside dropdown-togggle link doesnt work with only img tag inside dropdown-togggle link Nov 9, 2015
@jmartin84
Copy link

What browsers are you seeing this problem in?

@CWSpear
Copy link
Collaborator

CWSpear commented Nov 9, 2015

@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

@Hortt
Copy link
Author

Hortt commented Nov 10, 2015

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

@lllopo
Copy link

lllopo commented Mar 29, 2016

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
Copy link

lllopo commented Mar 29, 2016

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants