diff --git a/src/components/datagrid/body/cell/focus_utils.tsx b/src/components/datagrid/body/cell/focus_utils.tsx index 6d80a472955c..77b655eb6cb5 100644 --- a/src/components/datagrid/body/cell/focus_utils.tsx +++ b/src/components/datagrid/body/cell/focus_utils.tsx @@ -11,6 +11,7 @@ import React, { FunctionComponent, useEffect, useState, + useMemo, } from 'react'; import { tabbable } from 'tabbable'; @@ -58,9 +59,10 @@ export const HandleInteractiveChildren: FunctionComponent< } }, [cellEl, updateCellFocusContext]); - if (!cellEl) return children; // Do nothing if cell has yet to mount or is unmounting - if (!renderFocusTrap) return children; // Cells with default actions / expansion popovers do not need to trap - if (!hasInteractiveChildren) return children; // No need to focus trap if no children are interactive + const _children = useMemo(() => <>{children}, [children]); + if (!cellEl) return _children; // Do nothing if cell has yet to mount or is unmounting + if (!renderFocusTrap) return _children; // Cells with default actions / expansion popovers do not need to trap + if (!hasInteractiveChildren) return _children; // No need to focus trap if no children are interactive return ( {children}