Web:Client:Fixed hiding access selector if scrollHeight and list items are equal.

This commit is contained in:
gazizova-vlada 2023-08-17 15:04:22 +03:00
parent ceb2a85979
commit 52919ec564

View File

@ -57,6 +57,9 @@ const ItemsList = ({
scrollAllPanelContent,
inputsRef,
}) => {
const overflowStyleDefault = scrollAllPanelContent ? "hidden" : "scroll";
const [overflowStyle, setIsOverflowStyle] = useState(overflowStyleDefault);
const [bodyHeight, setBodyHeight] = useState(0);
const [offsetTop, setOffsetTop] = useState(0);
const [isTotalListHeight, setIsTotalListHeight] = useState(false);
@ -85,6 +88,14 @@ const ItemsList = ({
setIsTotalListHeight(
totalHeightItems >= listAreaHeight && totalHeightItems >= scrollHeight
);
if (
isOpenItemAccess &&
isTotalListHeight &&
scrollHeight === totalHeightItems
) {
setIsOverflowStyle("visible");
}
}, [
height,
bodyRef?.current?.offsetHeight,
@ -104,8 +115,6 @@ const ItemsList = ({
isOpenItemAccess,
]);
const overflowStyle = scrollAllPanelContent ? "hidden" : "scroll";
return (
<ScrollList
offsetTop={offsetTop}