From cf21329c04b28ef949b4fbe9fd54890daa222fb0 Mon Sep 17 00:00:00 2001 From: Julia Date: Fri, 27 Sep 2024 13:35:48 +0400 Subject: [PATCH] fixed copy bug --- src/assets/css/components/menu.css | 2 +- src/assets/js/main.js | 11 ++++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/assets/css/components/menu.css b/src/assets/css/components/menu.css index 715e53da4c4..91454651844 100644 --- a/src/assets/css/components/menu.css +++ b/src/assets/css/components/menu.css @@ -42,7 +42,7 @@ background-color: var(--color-focus-light); padding-left: calc( var(--space) / 4); } -::selection { +.menu::selection { background-color: transparent; } diff --git a/src/assets/js/main.js b/src/assets/js/main.js index 5f77211d944..fcb9d68cf29 100644 --- a/src/assets/js/main.js +++ b/src/assets/js/main.js @@ -25,9 +25,14 @@ document.addEventListener('DOMContentLoaded', () => { document.addEventListener('click', (e) => { allPopovers.forEach(popover => { - if (!popover.matches(":popover-open") && e.target !== mobileSidebarContent && !popover.matches(":popover-open") && e.target !== mobileSidebarDocs) { - mobileSidebarContent.classList.remove('open') - mobileSidebarDocs.classList.remove('open') + if (popover && !popover.matches(":popover-open") && e.target !== mobileSidebarContent && !popover.matches(":popover-open") && e.target !== mobileSidebarDocs) { + if(mobileSidebarContent && mobileSidebarContent.classList.contains('open')) { + mobileSidebarContent.classList.remove('open') + } + + if(mobileSidebarDocs && mobileSidebarDocs.classList.contains('open')) { + mobileSidebarDocs.classList.remove('open') + } } }) })