diff --git a/chrome/content/zotero/components/tabBar.jsx b/chrome/content/zotero/components/tabBar.jsx index d45f1e9eea..a33db03a1d 100644 --- a/chrome/content/zotero/components/tabBar.jsx +++ b/chrome/content/zotero/components/tabBar.jsx @@ -37,6 +37,7 @@ const TabBar = forwardRef(function (props, ref) { const [dragMouseX, setDragMouseX] = useState(0); const dragIDRef = useRef(null); const dragGrabbedDeltaXRef = useRef(); + const tabsInnerContainerRef = useRef(); const tabsRef = useRef(); const startArrowRef = useRef(); const endArrowRef = useRef(); @@ -85,17 +86,10 @@ const TabBar = forwardRef(function (props, ref) { }); function updateScrollArrows() { - let enableArrows = tabsRef.current.scrollWidth !== tabsRef.current.clientWidth; - if (enableArrows) { - startArrowRef.current.classList.add('enabled'); - endArrowRef.current.classList.add('enabled'); - } - else { - startArrowRef.current.classList.remove('enabled'); - endArrowRef.current.classList.remove('enabled'); - } + let scrollable = tabsRef.current.scrollWidth !== tabsRef.current.clientWidth; + if (scrollable) { + tabsInnerContainerRef.current.classList.add('scrollable'); - if (enableArrows) { if (tabsRef.current.scrollLeft !== 0) { startArrowRef.current.classList.add('active'); } @@ -110,6 +104,9 @@ const TabBar = forwardRef(function (props, ref) { endArrowRef.current.classList.remove('active'); } } + else { + tabsInnerContainerRef.current.classList.remove('scrollable'); + } } function handleTabMouseDown(event, id) { @@ -271,7 +268,7 @@ const TabBar = forwardRef(function (props, ref) { event.preventDefault(); } - function renderTab({ id, title, selected }, index) { + function renderTab({ id, title, selected, iconBackgroundImage }, index) { return (