rusackas commented on code in PR #42009:
URL: https://github.com/apache/superset/pull/42009#discussion_r3578667343
##########
superset-frontend/src/SqlLab/components/TableExploreTree/TreeNodeRenderer.tsx:
##########
@@ -215,6 +217,13 @@ const TreeNodeRenderer: React.FC<TreeNodeRendererProps> =
({
node.toggle();
}
}}
+ onKeyDown={handleKeyboardActivation(() => {
+ if (node.isLeaf) {
+ node.select();
+ } else {
+ node.toggle();
+ }
+ })}
Review Comment:
Checked the react-arborist source: rows already get `role="treeitem"` +
roving focus, and its container already activates the focused node on Space
(react-arborith DefaultContainer keydown handler). So this is functionally
covered at the tree level already. The `onKeyDown` here is there to satisfy
`click-events-have-key-events` on this inner div — removing it re-triggers that
lint error, so leaving it as-is.
##########
superset-frontend/src/SqlLab/components/TableExploreTree/TreeNodeRenderer.tsx:
##########
@@ -215,6 +217,13 @@ const TreeNodeRenderer: React.FC<TreeNodeRendererProps> =
({
node.toggle();
}
}}
+ onKeyDown={handleKeyboardActivation(() => {
+ if (node.isLeaf) {
+ node.select();
+ } else {
+ node.toggle();
+ }
+ })}
Review Comment:
Checked the react-arborist source: rows already get `role="treeitem"` +
roving focus, and its container already activates the focused node on Space
(its DefaultContainer keydown handler). So this is functionally covered at the
tree level already. The `onKeyDown` here is there to satisfy
`click-events-have-key-events` on this inner div — removing it re-triggers that
lint error, so leaving it as-is.
--
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]