fui-material 2.6.0 → 2.6.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/f-ui-kit.es.js
CHANGED
|
@@ -727,7 +727,7 @@ const FTableHead = ({
|
|
|
727
727
|
children,
|
|
728
728
|
textAlignment = "left",
|
|
729
729
|
// По умолчанию выравнивание слева
|
|
730
|
-
isSticky =
|
|
730
|
+
isSticky = true,
|
|
731
731
|
// По умолчанию заголовок не "липкий"
|
|
732
732
|
...props
|
|
733
733
|
}) => {
|
|
@@ -843,15 +843,17 @@ const FTable = ({
|
|
|
843
843
|
// По умолчанию горизонтальное переполнение автоматическое
|
|
844
844
|
overflowY = "auto",
|
|
845
845
|
// По умолчанию вертикальное переполнение автоматическое
|
|
846
|
+
isSticky = true,
|
|
847
|
+
// По умолчанию заголовок не "липкий"
|
|
846
848
|
...props
|
|
847
849
|
}) => {
|
|
848
850
|
const tableWrapperRef = useRef(null);
|
|
849
|
-
const [
|
|
851
|
+
const [isStickyState, setIsStickyState] = useState(false);
|
|
850
852
|
useEffect(() => {
|
|
851
853
|
const handleScroll = () => {
|
|
852
|
-
if (tableWrapperRef.current) {
|
|
854
|
+
if (tableWrapperRef.current && isSticky) {
|
|
853
855
|
const isScrolled = tableWrapperRef.current.scrollTop > 0;
|
|
854
|
-
|
|
856
|
+
setIsStickyState(isScrolled);
|
|
855
857
|
}
|
|
856
858
|
};
|
|
857
859
|
const wrapper = tableWrapperRef.current;
|
|
@@ -883,7 +885,7 @@ const FTable = ({
|
|
|
883
885
|
child,
|
|
884
886
|
{
|
|
885
887
|
...headProps,
|
|
886
|
-
isSticky
|
|
888
|
+
isSticky: isStickyState
|
|
887
889
|
}
|
|
888
890
|
);
|
|
889
891
|
}
|