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

Commit cf588a1

Browse files
committed
Fix opened parent details being mistaken as an immediate parent
1 parent bbaf00e commit cf588a1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,8 @@ function allowClosingDialog(details: Element): boolean {
8282

8383
function onSummaryClick(event: Event): void {
8484
if (!(event.currentTarget instanceof Element)) return
85-
const details = event.currentTarget.closest('details[open]')
86-
if (!details) return
85+
const details = event.currentTarget.closest('details')
86+
if (!details || !details.hasAttribute('open')) return
8787

8888
// Prevent summary click events if details-dialog-close was cancelled
8989
if (!allowClosingDialog(details)) {

0 commit comments

Comments
 (0)