@@ -2,7 +2,7 @@ import { isChrome as isChromeFn } from '@ui5/webcomponents-react-base/Device';
22import { useSyncRef } from '@ui5/webcomponents-react-base/internal/hooks' ;
33import { clsx } from 'clsx' ;
44import type { MutableRefObject } from 'react' ;
5- import { forwardRef , useEffect , useMemo , useRef } from 'react' ;
5+ import { forwardRef , useEffect , useRef } from 'react' ;
66import { FlexBoxDirection } from '../../../enums/FlexBoxDirection.js' ;
77import { FlexBox } from '../../FlexBox/index.js' ;
88import type { ClassNames } from '../types/index.js' ;
@@ -15,13 +15,14 @@ interface VerticalScrollbarProps {
1515 classNames : ClassNames ;
1616}
1717
18+ const isChrome = isChromeFn ( ) ;
19+
1820export const VerticalScrollbar = forwardRef < HTMLDivElement , VerticalScrollbarProps > ( ( props , ref ) => {
1921 const { internalRowHeight, tableRef, tableBodyHeight, scrollContainerRef, classNames } = props ;
2022 const hasHorizontalScrollbar = tableRef ?. current ?. offsetWidth !== tableRef ?. current ?. scrollWidth ;
2123 const horizontalScrollbarSectionStyles = clsx ( hasHorizontalScrollbar && classNames . bottomSection ) ;
2224 const [ componentRef , scrollbarRef ] = useSyncRef < HTMLDivElement > ( ref ) ;
2325 const contentRef = useRef < HTMLDivElement > ( null ) ;
24- const isChrome = useMemo ( ( ) => isChromeFn ( ) , [ ] ) ;
2526
2627 // Force style recalculation to fix Chrome scrollbar-color bug (track height not updating correctly)
2728 useEffect ( ( ) => {
@@ -42,7 +43,7 @@ export const VerticalScrollbar = forwardRef<HTMLDivElement, VerticalScrollbarPro
4243
4344 requestAnimationFrame ( forceScrollbarUpdate ) ;
4445 }
45- } , [ tableBodyHeight , scrollContainerRef . current ?. scrollHeight , scrollbarRef , isChrome ] ) ;
46+ } , [ tableBodyHeight , scrollContainerRef . current ?. scrollHeight , scrollbarRef ] ) ;
4647
4748 return (
4849 < FlexBox
0 commit comments