diff --git a/packages/react/src/components/UIShell/HeaderGlobalAction.js b/packages/react/src/components/UIShell/HeaderGlobalAction.js index 9472cbf87c8d..9ba30c82bd85 100644 --- a/packages/react/src/components/UIShell/HeaderGlobalAction.js +++ b/packages/react/src/components/UIShell/HeaderGlobalAction.js @@ -21,15 +21,18 @@ const { prefix } = settings; * * Note: children passed to this component should be an Icon. */ -const HeaderGlobalAction = ({ - 'aria-label': ariaLabel, - 'aria-labelledby': ariaLabelledBy, - children, - className: customClassName, - onClick, - isActive, - ...rest -}) => { +const HeaderGlobalAction = React.forwardRef(function HeaderGlobalAction( + { + 'aria-label': ariaLabel, + 'aria-labelledby': ariaLabelledBy, + children, + className: customClassName, + onClick, + isActive, + ...rest + }, + ref +) { const className = cx({ [customClassName]: !!customClassName, [`${prefix}--header__action`]: true, @@ -45,11 +48,12 @@ const HeaderGlobalAction = ({ {...accessibilityLabel} className={className} onClick={onClick} - type="button"> + type="button" + ref={ref}> {children} ); -}; +}); HeaderGlobalAction.propTypes = { /** @@ -80,4 +84,6 @@ HeaderGlobalAction.propTypes = { isActive: PropTypes.bool, }; +HeaderGlobalAction.displayName = 'HeaderGlobalAction'; + export default HeaderGlobalAction; diff --git a/packages/react/src/components/UIShell/HeaderPanel.js b/packages/react/src/components/UIShell/HeaderPanel.js index 70470a957e2f..7449ed298168 100644 --- a/packages/react/src/components/UIShell/HeaderPanel.js +++ b/packages/react/src/components/UIShell/HeaderPanel.js @@ -13,14 +13,17 @@ import { AriaLabelPropType } from '../../prop-types/AriaPropTypes'; const { prefix } = settings; -const HeaderPanel = ({ - 'aria-label': ariaLabel, - 'aria-labelledby': ariaLabelledBy, - children, - className: customClassName, - expanded, - ...other -}) => { +const HeaderPanel = React.forwardRef(function HeaderPanel( + { + 'aria-label': ariaLabel, + 'aria-labelledby': ariaLabelledBy, + children, + className: customClassName, + expanded, + ...other + }, + ref +) { const accessibilityLabel = { 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledBy, @@ -32,11 +35,11 @@ const HeaderPanel = ({ }); return ( -