From 89f5c4e74944668b4e2c9703da1d7f66ce3aaea5 Mon Sep 17 00:00:00 2001 From: Akmal Isomadinov Date: Tue, 25 Jun 2024 18:10:17 +0500 Subject: [PATCH 1/2] Client:Pages:Home:Section:Body Fixed bug 68591 --- .../client/src/pages/Home/Section/Body/index.js | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/packages/client/src/pages/Home/Section/Body/index.js b/packages/client/src/pages/Home/Section/Body/index.js index 7d9ded9697..56fc95a4e9 100644 --- a/packages/client/src/pages/Home/Section/Body/index.js +++ b/packages/client/src/pages/Home/Section/Body/index.js @@ -155,6 +155,17 @@ const SectionBodyContent = (props) => { } }; + const isHeaderOptionButton = (event) => { + const target = event?.target?.parentElement?.parentElement?.parentElement; + + if (!target) return false; + + const id = + target.getAttribute("id") ?? target?.parentElement.getAttribute("id"); + + return id === "header_optional-button"; + }; + const onMouseDown = (e) => { if ( (e.target.closest(".scroll-body") && @@ -165,7 +176,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); From dd0eb52c2615c00860e14d5b81b0d2fdcf24b7c8 Mon Sep 17 00:00:00 2001 From: Akmal Isomadinov Date: Wed, 26 Jun 2024 21:50:19 +0500 Subject: [PATCH 2/2] Client:Home:Section:Body Optimization and refactoring --- packages/client/src/pages/Home/Section/Body/index.js | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/packages/client/src/pages/Home/Section/Body/index.js b/packages/client/src/pages/Home/Section/Body/index.js index 56fc95a4e9..5c5063ad2d 100644 --- a/packages/client/src/pages/Home/Section/Body/index.js +++ b/packages/client/src/pages/Home/Section/Body/index.js @@ -156,14 +156,11 @@ const SectionBodyContent = (props) => { }; const isHeaderOptionButton = (event) => { - const target = event?.target?.parentElement?.parentElement?.parentElement; + const parent = document.querySelector("#header_optional-button"); - if (!target) return false; + if (!parent || !event.target) return false; - const id = - target.getAttribute("id") ?? target?.parentElement.getAttribute("id"); - - return id === "header_optional-button"; + return parent.contains(event.target); }; const onMouseDown = (e) => {