mirror of
https://github.com/shoelace-style/webawesome.git
synced 2026-01-12 20:19:13 +00:00
Fix click target
This commit is contained in:
@@ -113,7 +113,7 @@
|
||||
|
||||
// Expand and collapse code blocks
|
||||
document.addEventListener('click', event => {
|
||||
if (event.target.classList.contains('code-block__toggle')) {
|
||||
if (event.target.closest('.code-block__toggle')) {
|
||||
const codeBlock = event.target.closest('.code-block');
|
||||
codeBlock.classList.toggle('code-block--expanded');
|
||||
event.target.setAttribute('aria-expanded', codeBlock.classList.contains('code-block--expanded'));
|
||||
|
||||
Reference in New Issue
Block a user