Skip to content
This repository was archived by the owner on Sep 22, 2022. It is now read-only.

Commit 307d3ab

Browse files
committed
Fix autofocusing when details is not open
1 parent 0c93a12 commit 307d3ab

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ function loadIncludeFragment(event: Event) {
138138
if (src === null) return
139139

140140
loader.addEventListener('loadend', () => {
141-
autofocus(dialog)
141+
if (details.hasAttribute('open')) autofocus(dialog)
142142
})
143143
loader.setAttribute('src', src)
144144
}

0 commit comments

Comments
 (0)