Skip to content

Commit a673e7a

Browse files
committed
Reapply "Merge branch 'main' into 65-add-focus"
This reverts commit 6b03d63.
1 parent 6b03d63 commit a673e7a

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/Component.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,15 @@ export class Component<T extends HTMLElement = HTMLElement> extends ElementCompo
8989
return new Component<T>(element);
9090
}
9191

92+
/**
93+
* Test whether the element would be selected by the specified
94+
* {@link https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_selectors CSS selector}, or group of CSS selectors.
95+
* @param selectors
96+
*/
97+
public is(selectors: string): boolean {
98+
return this.node.matches(selectors);
99+
}
100+
92101
/**
93102
* Puts the element into
94103
* {@link https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/focus Focus}

0 commit comments

Comments
 (0)