mirror of
https://github.com/element-plus/element-plus.git
synced 2025-02-23 11:59:34 +08:00
fix(utils): fix type error (#8779)
This commit is contained in:
parent
33fc8e5c4e
commit
50f9a6c7c2
@ -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<Element> => {
|
||||
) => {
|
||||
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()
|
||||
|
Loading…
Reference in New Issue
Block a user