Tools for awaiting ready -- still can't make focus() work
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
import { waitForAnimationFrame } from "./event";
|
||||
|
||||
export class ElemWrapper {
|
||||
public elem: HTMLElement;
|
||||
|
||||
@@ -51,4 +53,10 @@ export class ElemWrapper {
|
||||
setID(id: string) {
|
||||
this.elem.id = id;
|
||||
}
|
||||
}
|
||||
|
||||
async waitForShadowQuerySelector(selector: string) {
|
||||
while (this.elem.shadowRoot?.querySelector(selector) === undefined) {
|
||||
await waitForAnimationFrame();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user