Issue #3211897 by mherchel, Gauravmahlawat: Olivero: On mobile width, submenu can unintendedly close when user attempts to scroll on mobile

merge-requests/646/head
Lauri Eskola 2021-05-07 13:10:35 +03:00
parent 8f711d9d84
commit 9d05a12a56
No known key found for this signature in database
GPG Key ID: 382FC0F5B0DF53F8
2 changed files with 2 additions and 4 deletions

View File

@ -166,9 +166,7 @@
(e) => { (e) => {
if ( if (
areAnySubNavsOpen() && areAnySubNavsOpen() &&
!e.target.matches( !e.target.matches('.header-nav, .header-nav *')
'.primary-nav__menu-item--has-children, .primary-nav__menu-item--has-children *',
)
) { ) {
closeAllSubNav(); closeAllSubNav();
} }

View File

@ -103,7 +103,7 @@
} }
}); });
document.addEventListener('touchstart', function (e) { document.addEventListener('touchstart', function (e) {
if (areAnySubNavsOpen() && !e.target.matches('.primary-nav__menu-item--has-children, .primary-nav__menu-item--has-children *')) { if (areAnySubNavsOpen() && !e.target.matches('.header-nav, .header-nav *')) {
closeAllSubNav(); closeAllSubNav();
} }
}, { }, {