@@ -12,10 +12,11 @@ import { Box, BoxButton, Icon, Text } from '@/components';
12
12
import { useCunninghamTheme } from '@/cunningham' ;
13
13
import { Doc , useTrans } from '@/features/docs/doc-management' ;
14
14
import { useActionableMode } from '@/features/docs/doc-tree/hooks/useActionableMode' ;
15
- import { useTreeItemKeyboardActivate } from '@/features/docs/doc-tree/hooks/useTreeItemKeyboardActivate' ;
16
15
import { useLeftPanelStore } from '@/features/left-panel' ;
17
16
import { useResponsiveStore } from '@/stores' ;
18
17
18
+ import { useKeyboardActivation } from '../hooks/useKeyboardActivation' ;
19
+
19
20
import SubPageIcon from './../assets/sub-page-logo.svg' ;
20
21
import { DocTreeItemActions } from './DocTreeItemActions' ;
21
22
@@ -80,7 +81,7 @@ export const DocSubPageItem = (props: TreeViewNodeProps<Doc>) => {
80
81
}
81
82
} ;
82
83
83
- useTreeItemKeyboardActivate ( isActive , handleActivate ) ;
84
+ useKeyboardActivation ( [ 'Enter' , ' ' ] , isActive , handleActivate , true ) ;
84
85
85
86
// prepare the text for the screen reader
86
87
const docTitle = doc . title || untitledDocument ;
@@ -151,14 +152,14 @@ export const DocSubPageItem = (props: TreeViewNodeProps<Doc>) => {
151
152
e . stopPropagation ( ) ;
152
153
handleActivate ( ) ;
153
154
} }
155
+ tabIndex = { - 1 }
154
156
$width = "100%"
155
157
$direction = "row"
156
158
$gap = { spacingsTokens [ 'xs' ] }
157
159
$align = "center"
158
160
$minHeight = "24px"
159
161
data-testid = { `doc-sub-page-item-${ doc . id } ` }
160
162
aria-label = { `${ t ( 'Open document' ) } ${ docTitle } ` }
161
- role = "button"
162
163
>
163
164
< Box $width = "16px" $height = "16px" aria-hidden = "true" >
164
165
< SubPageIcon />
0 commit comments