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

Extra checking in documentClick function (menu.vue file) #38

Closed
andazin opened this issue Jan 3, 2019 · 2 comments
Closed

Extra checking in documentClick function (menu.vue file) #38

andazin opened this issue Jan 3, 2019 · 2 comments

Comments

@andazin
Copy link
Contributor

andazin commented Jan 3, 2019

I had a problem with the menu in some complex pages.
Situation: the menu is present on the page, but hidden (not visible) and the Document onClick event bubbles to the menu component and caused the error because it was not related to the menu itself.
The simple fix eliminated the problem: just make the extra checking in documentClick function (menu.vue file) like this:

documentClick: function documentClick(e) {
  var element = document.querySelector('.bm-burger-button');
  var target;
  if(e && e.target) {
	  target = e.target;
	}
	else
	{
		target = null;
	}
  //var target = e.target;

  if ( element && element !== target && !element.contains(target) && e.target.className !== 'bm-menu') {
    this.closeMenu();
  }
}

Please, include this fix if possible.

@mbj36
Copy link
Owner

mbj36 commented Jan 4, 2019

Could you please open a PR, i will be happy to accept ? @andazin

@mbj36
Copy link
Owner

mbj36 commented Jan 4, 2019

#39 Fixed

@mbj36 mbj36 closed this as completed Jan 4, 2019
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

2 participants