Web:Client:Fixed hiding access selector if scrollHeight and list items are equal.
This commit is contained in:
parent
ceb2a85979
commit
52919ec564
@ -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}
|
||||
|
Loading…
Reference in New Issue
Block a user