🎨 焦点在关系图上时搜索快捷键报错

This commit is contained in:
Vanessa 2024-11-04 11:25:45 +08:00
parent 54a5d8b76a
commit 3a6ab971e2
3 changed files with 8 additions and 11 deletions

View file

@ -1,5 +1,5 @@
export const hasClosestByTag = (element: Node, nodeName: string) => {
if (!element) {
if (!element || element.nodeType === 9) {
return false;
}
if (element.nodeType === 3) {
@ -63,7 +63,7 @@ export const hasTopClosestByAttribute = (element: Node, attr: string, value: str
};
export const hasClosestByAttribute = (element: Node, attr: string, value: string | null, top = false) => {
if (!element) {
if (!element || element.nodeType === 9) {
return false;
}
if (element.nodeType === 3) {
@ -92,7 +92,7 @@ export const hasClosestBlock = (element: Node) => {
};
export const hasClosestByMatchTag = (element: Node, nodeName: string) => {
if (!element) {
if (!element || element.nodeType === 9) {
return false;
}
if (element.nodeType === 3) {
@ -111,7 +111,7 @@ export const hasClosestByMatchTag = (element: Node, nodeName: string) => {
};
export const hasClosestByClassName = (element: Node, className: string, top = false) => {
if (!element) {
if (!element || element.nodeType === 9) {
return false;
}
if (element.nodeType === 3) {