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

Commit 5fd52c4

Browse files
authored
Avoid setting role attribute if attribute is present
1 parent 5c625a0 commit 5fd52c4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ class DetailsDialogElement extends HTMLElement {
196196

197197
const summary = details.querySelector('summary')
198198
if (summary) {
199-
summary.setAttribute('role', 'button')
199+
if (!summary.hasAttribute('role')) summary.setAttribute('role', 'button')
200200
summary.addEventListener('click', onSummaryClick, {capture: true})
201201
}
202202

0 commit comments

Comments
 (0)