浏览代码

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

Elijah Ahianyo 6 月之前
父节点
当前提交
d6540b192e
共有 1 个文件被更改,包括 2 次插入2 次删除
  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"""
         f"""
 // Event listener for the parent click
 // Event listener for the parent click
 document.addEventListener('click', function(event) {{
 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 the parent is found
     if (parent) {{
     if (parent) {{
         // Find the SVG element within the parent
         // Find the SVG element within the parent