Skip to content

When the 'a' tag has child elements the hover doesnt always work because of the event.target #153

@aamjsadiq

Description

@aamjsadiq

When i tried something like

<a href="#">
 <i class="fa fa-icon-blah"></i>
<span>Something</span>
</a>

And the icon and the span are block elements the hover doesnt always seems to work.

I figured its because of the event.target check thats been

if(!$parent.hasClass('open') && !$parent.is(event.target)) {

And

if(!$parent.hasClass('open') && !$this.is(event.target) )

By changing these to:

if(!$parent.hasClass('open') && !$.contains($parent[0], $(event.target)[0])) {

And

if(!$parent.hasClass('open') && !$.contains($this[0], $(event.target)[0])) {

Seems to be fixing the issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions