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


##########
superset-frontend/src/explore/components/DataTableControl/index.tsx:
##########
@@ -61,26 +61,32 @@ export const CopyToClipboardButton = ({
 }: {
   data?: TabularDataRow[];
   columns?: string[];
-}) => (
-  <CopyToClipboard
-    text={
-      data && columns ? prepareCopyToClipboardTabularData(data, columns) : ''
-    }
-    wrapped={false}
-    copyNode={
-      <Icons.CopyOutlined
-        iconSize="l"
-        aria-label={t('Copy')}
-        role="button"
-        css={css`
-          &.anticon > * {
-            line-height: 0;
-          }
-        `}
-      />
-    }
-  />
-);
+}) => {
+  const theme = useTheme();
+  return (
+    <CopyToClipboard
+      text={
+        data && columns ? prepareCopyToClipboardTabularData(data, columns) : ''
+      }
+      wrapped={false}
+      copyNode={
+        <span>
+          <Icons.CopyOutlined
+            iconColor={theme.colorIcon}
+            iconSize="l"
+            aria-label={t('Copy')}
+            role="button"
+            css={css`
+              &.anticon > * {
+                line-height: 0;
+              }
+            `}

Review Comment:
   <div>
   
   
   <div id="suggestion">
   <div id="issue"><b>Accessibility: Misplaced ARIA attributes</b></div>
   <div id="fix">
   
   The role and aria-label attributes are on the inner icon, but the span is 
the element that gets the onClick handler from CopyToClipboard. For 
accessibility, these should be on the clickable span.
   </div>
   
   
   <details>
   <summary>
   <b>Code suggestion</b>
   </summary>
   <blockquote>Check the AI-generated fix before applying</blockquote>
   <div id="code">
   
   
   ````suggestion
         copyNode={
           <span
             role="button"
             aria-label={t('Copy')}
           >
             <Icons.CopyOutlined
               iconColor={theme.colorIcon}
               iconSize="l"
               css={css`
                 &.anticon > * {
                   line-height: 0;
                 }
               `}
             />
           </span>
         }
   ````
   
   </div>
   </details>
   
   
   
   </div>
   
   
   
   
   <small><i>Code Review Run #227501</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