From 83017f2a4adb2e4de719b68ae16897f01eaadd04 Mon Sep 17 00:00:00 2001 From: Michael Johnson Date: Fri, 26 Apr 2024 13:13:34 -0400 Subject: [PATCH] fix(RHINENG-9686): border-radius in toggle group This PR fixes the issue with the rounded edges of the ToggleGroupItems when a Tooltip is wrapped around the items. Adding the `triggerRef` removes the `
` that breaks the component. --- .../InventoryPageHeader.js | 81 +++++++++++-------- 1 file changed, 49 insertions(+), 32 deletions(-) diff --git a/src/routes/InventoryComponents/InventoryPageHeader.js b/src/routes/InventoryComponents/InventoryPageHeader.js index ca53a5df5..39ebb9d3d 100644 --- a/src/routes/InventoryComponents/InventoryPageHeader.js +++ b/src/routes/InventoryComponents/InventoryPageHeader.js @@ -1,4 +1,4 @@ -import React, { useContext } from 'react'; +import React, { useContext, useRef } from 'react'; import PropTypes from 'prop-types'; import { Split, @@ -20,37 +20,54 @@ import { pageContents } from '../InventoryPage'; import { AccountStatContext } from '../../Routes'; import FontAwesomeImageIcon from '../../components/FontAwesomeImageIcon'; -const InventoryContentToggle = ({ changeMainContent, mainContent }) => ( - - - - - View by - - - - - - - } - aria-label="Hybrid inventory" - isSelected={mainContent === pageContents.hybridInventory.key} - onChange={() => changeMainContent(pageContents.hybridInventory.key)} - /> - - - } - aria-label="Bifrost" - isSelected={mainContent === pageContents.bifrost.key} - onChange={() => changeMainContent(pageContents.bifrost.key)} - /> - - - - -); +const InventoryContentToggle = ({ changeMainContent, mainContent }) => { + const viewBySystemsToggle = useRef(null); + const viewByImagesToggle = useRef(null); + + return ( + + + + + View by + + + + + + + } + aria-label="Hybrid inventory" + isSelected={mainContent === pageContents.hybridInventory.key} + onChange={() => + changeMainContent(pageContents.hybridInventory.key) + } + /> + + + } + aria-label="Bifrost" + isSelected={mainContent === pageContents.bifrost.key} + onChange={() => changeMainContent(pageContents.bifrost.key)} + /> + + + + + ); +}; const InventoryPageHeader = (toggleProps) => { const isBifrostEnabled = useFeatureFlag('hbi.ui.bifrost');