Client:Home:Section:Body Optimization and refactoring

This commit is contained in:
Akmal Isomadinov 2024-06-26 21:50:19 +05:00
parent 89f5c4e749
commit dd0eb52c26

View File

@ -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) => {