|
@@ -5,7 +5,6 @@ import { debounce } from 'throttle-debounce';
|
|
|
import StickyEvents from 'sticky-events';
|
|
import StickyEvents from 'sticky-events';
|
|
|
import loggerFactory from '~/utils/logger';
|
|
import loggerFactory from '~/utils/logger';
|
|
|
|
|
|
|
|
-import NavigationContainer from '~/client/services/NavigationContainer';
|
|
|
|
|
import { withUnstatedContainers } from './UnstatedUtils';
|
|
import { withUnstatedContainers } from './UnstatedUtils';
|
|
|
|
|
|
|
|
const logger = loggerFactory('growi:cli:StickyStretchableScroller');
|
|
const logger = loggerFactory('growi:cli:StickyStretchableScroller');
|
|
@@ -49,7 +48,6 @@ const StickyStretchableScroller = (props) => {
|
|
|
|
|
|
|
|
let { scrollTargetSelector } = props;
|
|
let { scrollTargetSelector } = props;
|
|
|
const {
|
|
const {
|
|
|
- navigationContainer,
|
|
|
|
|
children, contentsElemSelector, stickyElemSelector,
|
|
children, contentsElemSelector, stickyElemSelector,
|
|
|
calcViewHeightFunc, calcContentsHeightFunc,
|
|
calcViewHeightFunc, calcContentsHeightFunc,
|
|
|
} = props;
|
|
} = props;
|
|
@@ -142,11 +140,11 @@ const StickyStretchableScroller = (props) => {
|
|
|
}, [resetScrollbarDebounced]);
|
|
}, [resetScrollbarDebounced]);
|
|
|
|
|
|
|
|
// setup effect by isScrollTop
|
|
// setup effect by isScrollTop
|
|
|
- useEffect(() => {
|
|
|
|
|
- if (navigationContainer.state.isScrollTop) {
|
|
|
|
|
- resetScrollbar();
|
|
|
|
|
- }
|
|
|
|
|
- }, [navigationContainer.state.isScrollTop, resetScrollbar]);
|
|
|
|
|
|
|
+ // useEffect(() => {
|
|
|
|
|
+ // if (navigationContainer.state.isScrollTop) {
|
|
|
|
|
+ // resetScrollbar();
|
|
|
|
|
+ // }
|
|
|
|
|
+ // }, [navigationContainer.state.isScrollTop, resetScrollbar]);
|
|
|
|
|
|
|
|
// setup effect by update props
|
|
// setup effect by update props
|
|
|
useEffect(() => {
|
|
useEffect(() => {
|
|
@@ -161,7 +159,6 @@ const StickyStretchableScroller = (props) => {
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
StickyStretchableScroller.propTypes = {
|
|
StickyStretchableScroller.propTypes = {
|
|
|
- navigationContainer: PropTypes.instanceOf(NavigationContainer).isRequired,
|
|
|
|
|
contentsElemSelector: PropTypes.string.isRequired,
|
|
contentsElemSelector: PropTypes.string.isRequired,
|
|
|
|
|
|
|
|
children: PropTypes.node,
|
|
children: PropTypes.node,
|
|
@@ -172,4 +169,4 @@ StickyStretchableScroller.propTypes = {
|
|
|
calcContentsHeightFunc: PropTypes.func,
|
|
calcContentsHeightFunc: PropTypes.func,
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
-export default withUnstatedContainers(StickyStretchableScroller, [NavigationContainer]);
|
|
|
|
|
|
|
+export default StickyStretchableScroller;
|