mdbootstrap / bootstrap-hover-dropdown

An unofficial Bootstrap plugin to enable Bootstrap dropdowns to activate on hover and provide a nice user experience.
http://cameronspear.com/demos/bootstrap-hover-dropdown/
MIT License
1.26k stars 503 forks source link

Transverse up DOM tree and match correct target when object does not … #122

Open redavis opened 9 years ago

redavis commented 9 years ago

…contain data-hover.

redavis commented 9 years ago

Cameron, See the following markup to duplicate issue.

<ul class="list-unstyled">
  <li class="dropdown">
      <a style="display:block" href="#" class="dropdown-toggle" data-toggle="dropdown" data-hover="dropdown" data-delay="500">
        <div>My Special</div>
        <small>Contextual Menu</small>
      </a>
      <ul class="dropdown-menu">
        <li><a tabindex="-1" href="#">Why Would</a></li>
        <li><a tabindex="-1" href="#">A Home Tab</a></li>
        <li><a tabindex="-1" href="#">Have Dropdowns?</a></li>
      </ul>
    </li>
</ul>

The event may end up being targeted to <div>My Special</div> and stop it from executing.

Let me know if you think there is a better way to deal with this.

lllopo commented 8 years ago

Not working for me, similar setup. What I did is : if(!$parent.hasClass('open') && !$this.is(event.target) && !$.contains($this[0], event.target)) { on line 50