diff --git a/src/modal/modal.ts b/src/modal/modal.ts index 54ce555..19de845 100644 --- a/src/modal/modal.ts +++ b/src/modal/modal.ts @@ -117,9 +117,10 @@ export default class ModalElement extends HTMLElement { private async wasOpened() { this.hidden = false; - await hello(this); - this.focusTrap?.activate(); + hello(this); + + requestAnimationFrame(() => this.focusTrap?.activate()); this.dispatchEvent(new Event('open')); }