From 01e4ef8902869067826b8ba277fcbd826d1c4254 Mon Sep 17 00:00:00 2001 From: instructure-ui-ci Date: Mon, 19 Jun 2023 10:34:32 +0200 Subject: [PATCH] WIP(ui-dom-utils): update `findFocusable` logic --- packages/ui-dom-utils/src/__tests__/findTabbable.test.tsx | 3 --- packages/ui-dom-utils/src/findFocusable.ts | 7 +------ 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/packages/ui-dom-utils/src/__tests__/findTabbable.test.tsx b/packages/ui-dom-utils/src/__tests__/findTabbable.test.tsx index b0d6860dbf..5694bc0d35 100644 --- a/packages/ui-dom-utils/src/__tests__/findTabbable.test.tsx +++ b/packages/ui-dom-utils/src/__tests__/findTabbable.test.tsx @@ -43,9 +43,6 @@ describe('findTabbable', async () => { -
- -
) /* eslint-enable jsx-a11y/no-noninteractive-tabindex */ diff --git a/packages/ui-dom-utils/src/findFocusable.ts b/packages/ui-dom-utils/src/findFocusable.ts index a4dbdb8624..7fd7e6a54d 100644 --- a/packages/ui-dom-utils/src/findFocusable.ts +++ b/packages/ui-dom-utils/src/findFocusable.ts @@ -83,12 +83,7 @@ function findFocusable( function hidden(element: Element | Node) { const cs = getComputedStyle(element) - return ( - (cs.display !== 'inline' && - (element as HTMLElement).offsetWidth <= 0 && - (element as HTMLElement).offsetHeight <= 0) || - cs.display === 'none' - ) + return cs.display === 'none' } function positioned(element: Element | Node) {