Skip to content

Commit

Permalink
Merge branch 'main' into dkilgore-eightfold/select-options-callback-f…
Browse files Browse the repository at this point in the history
…ixup
  • Loading branch information
dkilgore-eightfold authored Mar 21, 2023
2 parents f474816 + a64a582 commit 43ca404
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/components/Table/Internal/Body/Scroller.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -118,10 +118,18 @@ export const Scroller = React.forwardRef(
});
};

const noScroller = (): boolean => {
return (
scrollBodyRef?.current?.clientWidth >=
scrollBodyRef?.current?.scrollWidth
);
};

const onBodyScroll = (): void => {
const bodyScrollLeft: number = scrollBodyRef.current.scrollLeft;
const bodyWidth: number = scrollBodyRef.current.clientWidth;
const bodyScrollWidth: number = scrollBodyRef.current.scrollWidth;

if (bodyScrollLeft === 0) {
setLeftButtonVisible(false);
setRightButtonVisible(true);
Expand Down Expand Up @@ -155,6 +163,8 @@ export const Scroller = React.forwardRef(
};
}, []);

if (noScroller()) return null;

return (
<>
<SecondaryButton
Expand Down

0 comments on commit 43ca404

Please sign in to comment.