From 50f9a6c7c248ceab331cd2d5827d2b94b0056038 Mon Sep 17 00:00:00 2001 From: zz <2418184580@qq.com> Date: Wed, 13 Jul 2022 18:48:11 +0800 Subject: [PATCH] fix(utils): fix type error (#8779) --- packages/utils/dom/aria.ts | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/packages/utils/dom/aria.ts b/packages/utils/dom/aria.ts index 67e6fbe68b..1132f3803e 100644 --- a/packages/utils/dom/aria.ts +++ b/packages/utils/dom/aria.ts @@ -1,6 +1,3 @@ -// @ts-nocheck -import type { Nullable } from '../typescript' - const FOCUSABLE_ELEMENT_SELECTORS = `a[href],button:not([disabled]),button:not([hidden]),:not([tabindex="-1"]),input:not([disabled]),input:not([type="hidden"]),select:not([disabled]),textarea:not([disabled])` /** @@ -114,7 +111,7 @@ export const getSibling = ( el: HTMLElement, distance: number, elClass: string -): Nullable => { +) => { const { parentNode } = el if (!parentNode) return null const siblings = parentNode.querySelectorAll(elClass) @@ -122,7 +119,7 @@ export const getSibling = ( return siblings[index + distance] || null } -export const focusNode = (el) => { +export const focusNode = (el: HTMLElement) => { if (!el) return el.focus() !isLeaf(el) && el.click()