diff --git a/packages/client/src/pages/Home/Section/Body/index.js b/packages/client/src/pages/Home/Section/Body/index.js index 7d9ded9697..5c5063ad2d 100644 --- a/packages/client/src/pages/Home/Section/Body/index.js +++ b/packages/client/src/pages/Home/Section/Body/index.js @@ -155,6 +155,14 @@ const SectionBodyContent = (props) => { } }; + const isHeaderOptionButton = (event) => { + const parent = document.querySelector("#header_optional-button"); + + if (!parent || !event.target) return false; + + return parent.contains(event.target); + }; + const onMouseDown = (e) => { if ( (e.target.closest(".scroll-body") && @@ -165,7 +173,8 @@ const SectionBodyContent = (props) => { !e.target.closest(".document-catalog")) || e.target.closest(".files-main-button") || e.target.closest(".add-button") || - e.target.closest("#filter_search-input") + e.target.closest("#filter_search-input") || + isHeaderOptionButton(e) ) { setSelection([]); setBufferSelection(null);