{"action":"created","issue":{"url":"https://api.github.com/repos/FrDH/jQuery.mmenu/issues/747","repository_url":"https://api.github.com/repos/FrDH/jQuery.mmenu","labels_url":"https://api.github.com/repos/FrDH/jQuery.mmenu/issues/747/labels{/name}","comments_url":"https://api.github.com/repos/FrDH/jQuery.mmenu/issues/747/comments","events_url":"https://api.github.com/repos/FrDH/jQuery.mmenu/issues/747/events","html_url":"https://github.com/FrDH/jQuery.mmenu/issues/747","id":233188833,"number":747,"title":"Anchor tags not working at all when mmenu installed","user":{"login":"Tony-S","id":12936515,"avatar_url":"https://avatars3.githubusercontent.com/u/12936515?v=3","gravatar_id":"","url":"https://api.github.com/users/Tony-S","html_url":"https://github.com/Tony-S","followers_url":"https://api.github.com/users/Tony-S/followers","following_url":"https://api.github.com/users/Tony-S/following{/other_user}","gists_url":"https://api.github.com/users/Tony-S/gists{/gist_id}","starred_url":"https://api.github.com/users/Tony-S/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Tony-S/subscriptions","organizations_url":"https://api.github.com/users/Tony-S/orgs","repos_url":"https://api.github.com/users/Tony-S/repos","events_url":"https://api.github.com/users/Tony-S/events{/privacy}","received_events_url":"https://api.github.com/users/Tony-S/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2017-06-02T13:48:19Z","updated_at":"2017-06-06T09:59:24Z","closed_at":null,"body":"mmenu is installed and working on my new site but it stops all the anchor tags working both within the menu and elsewhere on the site. The latest code has been used. 6.1.0\r\nI've already used it another site where it's all working fine including links (Not a Magento site). This was version 5.7.8. The new site is a Magento 1 site and I've hand installed mmenu using the same principals as before. The menu opens and expands ok but no anchor tags work.\r\nFiles loaded are:\r\njQuery 1.8.3 (loaded in the site as standard)\r\njquery.mmenu.js\r\njquery.mmenu.navbars.js\r\njquery.mmenu.searchfield.js\r\nmmenu_setup.js (see below)\r\njquery.mmenu.css\r\njquery.mmenu.navbars.css\r\njquery.mmenu.searchfield.css\r\njquery.mmenu.fullscreen.css\r\n\r\nThe failure is consistent across Edge, Chrome, FF, whether in desktop view or mobile emulation.\r\nThere are no console errors showing. There is a console warning showing in Chrome of \"[Intervention] Unable to preventDefault inside passive event listener due to target being treated as passive. See https://www.chromestatus.com/features/5093566007214080\". One of these appears for every anchor tag click including the ones which open and close the menu (which do work).\r\n\r\nIf I completely comment out a block of code as below from jquery.mmenu.js then all the anchor tags work again but the menu doesn't.\r\n```\r\n                    /*o.$body.on(r.click + \"-oncanvas\", \"a[href]\", function (i) {\r\n                        var a = t(this), r = !1, o = e.$menu.find(a).length;\r\n                        for (var l in t[n].addons)if (t[n].addons[l].clickAnchor.call(e, a, o)) {\r\n                            r = !0;\r\n                            break\r\n                        }\r\n                        var d = a.attr(\"href\");\r\n                        if (!r && o && d.length > 1 && \"#\" == d.slice(0, 1))try {\r\n                            var c = t(d, e.$menu);\r\n                            c.is(\".\" + s.panel) && (r = !0, e[a.parent().hasClass(s.vertical) ? \"togglePanel\" : \"openPanel\"](c))\r\n                        } catch (h) {\r\n                        }\r\n                        if (r && i.preventDefault(), !r && o && a.is(\".\" + s.listview + \" > li > a\") && !a.is('[rel=\"external\"]') && !a.is('[target=\"_blank\"]')) {\r\n                            e.__valueOrFn(e.opts.onClick.setSelected, a) && e.setSelected(t(i.target).parent());\r\n                            var f = e.__valueOrFn(e.opts.onClick.preventDefault, a, \"#\" == d.slice(0, 1));\r\n                            f && i.preventDefault(), e.__valueOrFn(e.opts.onClick.close, a, f) && e.close()\r\n                        }\r\n                    })*/\r\n```\r\nIf I comment out just the contents of that function then the original problem remains.\r\n\r\nI tried adding the debugger code but got the following console error on page load:\r\n\"jquery.mmenu.debugger.js:488 Uncaught TypeError: Cannot read property 'drop' of undefined\" which refers to this line in the debugger file \"if ( this.opts.dropdown.drop )\". The original problem remains and nothing else appears in the console.\r\n\r\nThe mmenu_setup.js file has the menu setup as follows. This is directly based on my previous working site.\r\n```\r\njQuery(document).ready(function () {\r\n    //main mmenu\r\n    jQuery(\"#nav-mobile-source\").mmenu({\r\n        // options\r\n        \"extensions\": [\r\n            \"fullscreen\",\r\n            \"multiline\"],\r\n        \"offCanvas\": {\r\n            \"position\": \"left\",\r\n            \"zposition\": \"front\"\r\n        },\r\n        \"navbars\": [\r\n            {\r\n                \"content\": [\"prev\", \"title\", \"close\"]\r\n            },{\r\n                \"content\": [\"searchfield\"],\r\n                \"postion\": \"top\"\r\n            },\r\n\r\n\r\n        ],\r\n        \"searchfield\": {\r\n            \"resultsPanel\": true,\r\n            \"showSubPanels\": false,\r\n            \"placeholder\": \"Search menu\",\r\n        },\r\n    }, {\r\n        // configuration\r\n        \"offCanvas\": {\r\n            \"pageSelector\": \"#wrapper-main\",\r\n            \"wrapPageIfNeeded\": false,\r\n        },\r\n        \"searchfield\": {\r\n            \"clear\": true\r\n        }\r\n    });\r\n});\r\n```\r\nI have found a couple of other people reporting this same issue in the past but there were no solutions shown.\r\nThe site is x.kitchendoorhub.com (in development)."},"comment":{"url":"https://api.github.com/repos/FrDH/jQuery.mmenu/issues/comments/306439204","html_url":"https://github.com/FrDH/jQuery.mmenu/issues/747#issuecomment-306439204","issue_url":"https://api.github.com/repos/FrDH/jQuery.mmenu/issues/747","id":306439204,"user":{"login":"FrDH","id":1387163,"avatar_url":"https://avatars3.githubusercontent.com/u/1387163?v=3","gravatar_id":"","url":"https://api.github.com/users/FrDH","html_url":"https://github.com/FrDH","followers_url":"https://api.github.com/users/FrDH/followers","following_url":"https://api.github.com/users/FrDH/following{/other_user}","gists_url":"https://api.github.com/users/FrDH/gists{/gist_id}","starred_url":"https://api.github.com/users/FrDH/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/FrDH/subscriptions","organizations_url":"https://api.github.com/users/FrDH/orgs","repos_url":"https://api.github.com/users/FrDH/repos","events_url":"https://api.github.com/users/FrDH/events{/privacy}","received_events_url":"https://api.github.com/users/FrDH/received_events","type":"User","site_admin":false},"created_at":"2017-06-06T09:59:24Z","updated_at":"2017-06-06T09:59:24Z","body":"If I understand the docs on https://www.chromestatus.com and your findings correctly, there is an issue when combining an onClick with an onTouchstart event. I find it really odd that commenting out the contents of a \"bind\" function results in an issue, where commenting out the entire \"bind\" does not.\r\nCould you try commenting out the contents and add / replace it with a `return true;`?\r\n\r\n````js\r\no.$body.on(r.click + \"-oncanvas\", \"a[href]\", function (i) {\r\n    return true;\r\n});\r\n````"}}
{"actor":{"display_login":"FrDH"}}