From b54cbad876d63df0c280bcd0a843eee7199bf3f7 Mon Sep 17 00:00:00 2001 From: Matt Gallo Date: Wed, 5 Jun 2024 10:06:37 -0400 Subject: [PATCH] fix(Datagrid): add optional chain for focus row expander hook (#5363) Co-authored-by: kennylam <909118+kennylam@users.noreply.github.com> --- .../ibm-products/src/components/Datagrid/useFocusRowExpander.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/ibm-products/src/components/Datagrid/useFocusRowExpander.js b/packages/ibm-products/src/components/Datagrid/useFocusRowExpander.js index 594bd1f345..1afc899e95 100644 --- a/packages/ibm-products/src/components/Datagrid/useFocusRowExpander.js +++ b/packages/ibm-products/src/components/Datagrid/useFocusRowExpander.js @@ -36,7 +36,7 @@ export const useFocusRowExpander = ({ const rowExpander = activeRow[0].querySelector( `.${blockClass}__row-expander` ); - rowExpander.focus(); + rowExpander?.focus(); } }, [ instance?.tableId,