From d6540b192e2096594de74c3eb96627d6071b5ee1 Mon Sep 17 00:00:00 2001 From: Elijah Ahianyo Date: Wed, 30 Oct 2024 15:54:22 +0000 Subject: [PATCH] Fix for shiki copy button animation firing off after clicking copy button (#4252) --- reflex/components/datadisplay/shiki_code_block.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/reflex/components/datadisplay/shiki_code_block.py b/reflex/components/datadisplay/shiki_code_block.py index 46199a6e4..6ce6916c6 100644 --- a/reflex/components/datadisplay/shiki_code_block.py +++ b/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