Skip to content

Commit

Permalink
fix: dynamic sticky (#1184)
Browse files Browse the repository at this point in the history
Co-authored-by: afc163 <afc163@gmail.com>
  • Loading branch information
linxianxi and afc163 committed Aug 28, 2024
1 parent bedfc01 commit 934448a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/hooks/useSticky.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,9 @@ export default function useSticky(

const container = getContainer() || defaultContainer;

const isSticky = !!sticky;

return React.useMemo(() => {
const isSticky = !!sticky;
return {
isSticky,
stickyClassName: isSticky ? `${prefixCls}-sticky-holder` : '',
Expand All @@ -36,5 +37,5 @@ export default function useSticky(
offsetScroll,
container,
};
}, [offsetScroll, offsetHeader, offsetSummary, prefixCls, container]);
}, [isSticky, offsetScroll, offsetHeader, offsetSummary, prefixCls, container]);
}

0 comments on commit 934448a

Please sign in to comment.