bito-code-review[bot] commented on code in PR #41958:
URL: https://github.com/apache/superset/pull/41958#discussion_r3563991501


##########
superset-frontend/src/components/CopyToClipboard/index.tsx:
##########
@@ -86,8 +86,16 @@ function CopyToClip({
           cursor,
         },
         onClick: disabled ? undefined : onClick,
+        onKeyDown: disabled
+          ? undefined
+          : (event: KeyboardEvent<HTMLElement>) => {
+              if (event.key === 'Enter' || event.key === ' ') {
+                event.preventDefault();
+                onClick();
+              }
+            },

Review Comment:
   <div>
   
   
   <div id="suggestion">
   <div id="issue"><b>Duplicate keyboard handler logic</b></div>
   <div id="fix">
   
   The onKeyDown handler (lines 89-96) duplicates the exact same logic as 
`handleKeyDown` (lines 101-109). Both handle Enter/Space keys identically but 
diverge on future changes. Extract into a shared helper function to maintain 
consistency.
   </div>
   
   
   </div>
   
   
   
   
   <small><i>Code Review Run #d350b4</i></small>
   </div>
   
   ---
   Should Bito avoid suggestions like this for future reviews? (<a 
href=https://alpha.bito.ai/home/ai-agents/review-rules>Manage Rules</a>)
   - [ ] Yes, avoid them



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to