Fix for shiki copy button animation firing off after clicking copy button (#4252)

This commit is contained in:
Elijah Ahianyo 2024-10-30 15:54:22 +00:00 committed by GitHub
parent d478387007
commit d6540b192e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -33,8 +33,8 @@ def copy_script() -> Any:
f"""
// Event listener for the parent click
document.addEventListener('click', function(event) {{
// Find the closest div (parent element)
const parent = event.target.closest('div');
// Find the closest button (parent element)
const parent = event.target.closest('button');
// If the parent is found
if (parent) {{
// Find the SVG element within the parent