{"action":"opened","issue":{"url":"https://api.github.com/repos/mbj36/vue-burger-menu/issues/38","repository_url":"https://api.github.com/repos/mbj36/vue-burger-menu","labels_url":"https://api.github.com/repos/mbj36/vue-burger-menu/issues/38/labels{/name}","comments_url":"https://api.github.com/repos/mbj36/vue-burger-menu/issues/38/comments","events_url":"https://api.github.com/repos/mbj36/vue-burger-menu/issues/38/events","html_url":"https://github.com/mbj36/vue-burger-menu/issues/38","id":395751427,"node_id":"MDU6SXNzdWUzOTU3NTE0Mjc=","number":38,"title":"Extra checking in documentClick function (menu.vue file)","user":{"login":"andazin","id":1385960,"node_id":"MDQ6VXNlcjEzODU5NjA=","avatar_url":"https://avatars2.githubusercontent.com/u/1385960?v=4","gravatar_id":"","url":"https://api.github.com/users/andazin","html_url":"https://github.com/andazin","followers_url":"https://api.github.com/users/andazin/followers","following_url":"https://api.github.com/users/andazin/following{/other_user}","gists_url":"https://api.github.com/users/andazin/gists{/gist_id}","starred_url":"https://api.github.com/users/andazin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andazin/subscriptions","organizations_url":"https://api.github.com/users/andazin/orgs","repos_url":"https://api.github.com/users/andazin/repos","events_url":"https://api.github.com/users/andazin/events{/privacy}","received_events_url":"https://api.github.com/users/andazin/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2019-01-03T22:44:41Z","updated_at":"2019-01-03T22:44:41Z","closed_at":null,"author_association":"NONE","body":"I had a problem with the menu in some complex pages. \r\nSituation: 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.\r\nThe simple fix eliminated the problem: just make the extra checking in documentClick function (menu.vue file) like this:\r\n\r\n    documentClick: function documentClick(e) {\r\n      var element = document.querySelector('.bm-burger-button');\r\n      var target;\r\n      if(e && e.target) {\r\n\t\t  target = e.target;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\ttarget = null;\r\n\t\t}\r\n      //var target = e.target;\r\n\r\n      if ( element && element !== target && !element.contains(target) && e.target.className !== 'bm-menu') {\r\n        this.closeMenu();\r\n      }\r\n    }\r\n\r\n\r\nPlease, include this fix if possible."}}
{"actor":{"display_login":"andazin"}}