From 0ec719663fe5f95794db23105374855d484c9ad7 Mon Sep 17 00:00:00 2001 From: Matt Gallo Date: Mon, 5 Feb 2024 09:13:42 -0500 Subject: [PATCH] fix(Datagrid): check for document before continuing (#4205) --- .../src/components/Datagrid/useNestedRowExpander.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/ibm-products/src/components/Datagrid/useNestedRowExpander.js b/packages/ibm-products/src/components/Datagrid/useNestedRowExpander.js index c2ad7d6ffd..f81c353cbc 100644 --- a/packages/ibm-products/src/components/Datagrid/useNestedRowExpander.js +++ b/packages/ibm-products/src/components/Datagrid/useNestedRowExpander.js @@ -1,6 +1,6 @@ /* eslint-disable react/prop-types */ /** - * Copyright IBM Corp. 2020, 2023 + * Copyright IBM Corp. 2020, 2024 * * This source code is licensed under the Apache-2.0 license found in the * LICENSE file in the root directory of this source tree. @@ -25,7 +25,7 @@ const useNestedRowExpander = (hooks) => { instance: tempState?.current, lastExpandedRowIndex: lastExpandedRowIndex?.current, blockClass, - activeElement: document.activeElement, + activeElement: typeof document !== 'undefined' && document.activeElement, }); const visibleColumns = (columns) => {