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

Padding and margin prevents openDropdown event #161

Open
webprogrammierer opened this issue Jul 24, 2017 · 0 comments
Open

Padding and margin prevents openDropdown event #161

webprogrammierer opened this issue Jul 24, 2017 · 0 comments

Comments

@webprogrammierer
Copy link

On my navbar anchor elements I have some padding and margin like this:

  .navbar-nav > li > a {
    padding-top: 16px;
    padding-bottom: 0px;
    padding-left: 5px;
    padding-right: 5px;
    margin-left: 8px;
    margin-right: 8px;
  }

This seems to be the reason why the openDropdown event is not called anymore in any cases: So you move your mouse over the menu items (hover) and sometimes the menu items open and sometimes they do not open.

The following code should be removed or improved to get the hover menu work proper also with padding and margin:

                // so a neighbor can't open the dropdown
                if(!$parent.hasClass('open') && !$this.is(event.target)) {
                    // stop this event, stop executing any code
                    // in this callback but continue to propagate
                    return true;
                }
                // this helps prevent a double event from firing.
                // see https://github.com/CWSpear/bootstrap-hover-dropdown/issues/55
                if(!$parent.hasClass('open') && !$parent.is(event.target)) {
                    // stop this event, stop executing any code
                    // in this callback but continue to propagate
                    return true;
                }
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

1 participant