bito-code-review[bot] commented on code in PR #41912:
URL: https://github.com/apache/superset/pull/41912#discussion_r3614306720
##########
superset-frontend/src/features/home/SavedQueries.tsx:
##########
@@ -297,11 +298,12 @@ export const SavedQueries = ({
{queries.length > 0 ? (
<CardContainer showThumbnails={showThumbnails}>
{queries.map(q => (
- <CardStyles key={q.id}>
+ <CardStyles
+ key={q.id}
+ onClick={() => history.push(`/sqllab?savedQueryId=${q.id}`)}
Review Comment:
<!-- Bito Reply -->
The implementation correctly addresses the accessibility issue by adding
button semantics and keyboard event handling to the card wrapper. The use of
`role='button'` and `tabIndex={0}` ensures the element is focusable and
identified as a button, while the `onKeyDown` handler allows for activation via
Enter or Space keys. This approach maintains the expected behavior for nested
controls like the kebab menu.
**superset-frontend/src/features/home/SavedQueries.tsx**
```
<CardStyles
key={q.id}
onClick={() => history.push(`/sqllab?savedQueryId=${q.id}`)}
role="button"
tabIndex={0}
onKeyDown={e => {
if (['Enter', ' '].includes(e.key)) {
history.push(`/sqllab?savedQueryId=${q.id}`);
}
}}
```
--
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]