element-ready
Advanced tools
+1
-1
@@ -32,3 +32,3 @@ import type {ParseSelector} from 'typed-query-selector/parser.js'; | ||
| */ | ||
| readonly signal?: AbortSignal; | ||
| readonly signal?: AbortSignal | undefined; | ||
@@ -35,0 +35,0 @@ /** |
+6
-15
@@ -36,9 +36,5 @@ import requestAnimationFrames from 'request-animation-frames'; | ||
| let current = element; | ||
| while (current) { | ||
| if (!waitForChildren || current.nextSibling) { | ||
| return element; | ||
| } | ||
| current = current.parentElement; | ||
| // Only check the element's own nextSibling, not ancestors, to avoid false positives | ||
| if (element && (!waitForChildren || element.nextSibling)) { | ||
| return element; | ||
| } | ||
@@ -93,10 +89,5 @@ } | ||
| let current = element; | ||
| while (current) { | ||
| if (!waitForChildren || current.nextSibling) { | ||
| yield element; | ||
| break; | ||
| } | ||
| current = current.parentElement; | ||
| // Only check the element's own nextSibling, not ancestors, to avoid false positives | ||
| if (!waitForChildren || element.nextSibling) { | ||
| yield element; | ||
| } | ||
@@ -103,0 +94,0 @@ } |
+2
-2
| { | ||
| "name": "element-ready", | ||
| "version": "9.0.0", | ||
| "version": "9.0.1", | ||
| "description": "Detect when an element is ready in the DOM", | ||
@@ -23,3 +23,3 @@ "license": "MIT", | ||
| "scripts": { | ||
| "test": "xo && ava && tsd" | ||
| "test": "xo && node --test test.js && tsd" | ||
| }, | ||
@@ -26,0 +26,0 @@ "files": [ |
12647
0.11%194
-3.48%