diff --git a/components/lib/scrollpanel/ScrollPanel.js b/components/lib/scrollpanel/ScrollPanel.js index 038b25df2a..6e2f4a3ec8 100644 --- a/components/lib/scrollpanel/ScrollPanel.js +++ b/components/lib/scrollpanel/ScrollPanel.js @@ -51,6 +51,7 @@ export const ScrollPanel = React.forwardRef((inProps, ref) => { }; const moveBar = () => { + if (!contentRef.current) return; // horizontal scroll const totalWidth = contentRef.current.scrollWidth; const ownWidth = contentRef.current.clientWidth;