Explorar o código

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

Elijah Ahianyo hai 6 meses
pai
achega
d6540b192e
Modificáronse 1 ficheiros con 2 adicións e 2 borrados
  1. 2 2
      reflex/components/datadisplay/shiki_code_block.py

+ 2 - 2
reflex/components/datadisplay/shiki_code_block.py

@@ -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