Skip to content

Commit

Permalink
deriveCSSSelector: accept undefined elements
Browse files Browse the repository at this point in the history
  • Loading branch information
martrapp committed Jun 13, 2024
1 parent bddaec8 commit fc19952
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion components/derive-css-selector.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export function deriveCSSSelector(element: Element, useIds = true) {
export function deriveCSSSelector(element?: Element, useIds = true) {
let path: string[] = [];
while (element && element.nodeType === Node.ELEMENT_NODE) {
let selector = element.nodeName.toLowerCase();
Expand Down

0 comments on commit fc19952

Please sign in to comment.