mirror of
https://github.com/Redocly/redoc.git
synced 2024-11-10 19:06:34 +03:00
feat: enable keyboard navigation (#2361)
This commit is contained in:
parent
8fbc955f12
commit
d21af58414
|
@ -44,7 +44,13 @@ export class MenuItem extends React.Component<MenuItemProps> {
|
|||
render() {
|
||||
const { item, withoutChildren } = this.props;
|
||||
return (
|
||||
<MenuItemLi onClick={this.activate} depth={item.depth} data-item-id={item.id} role="menuitem">
|
||||
<MenuItemLi
|
||||
tabIndex={0}
|
||||
onClick={this.activate}
|
||||
depth={item.depth}
|
||||
data-item-id={item.id}
|
||||
role="menuitem"
|
||||
>
|
||||
{item.type === 'operation' ? (
|
||||
<OperationMenuItemContent {...this.props} item={item as OperationModel} />
|
||||
) : (
|
||||
|
@ -96,7 +102,7 @@ export const OperationMenuItemContent = observer((props: OperationMenuItemConten
|
|||
) : (
|
||||
<OperationBadge type={item.httpVerb}>{shortenHTTPVerb(item.httpVerb)}</OperationBadge>
|
||||
)}
|
||||
<MenuItemTitle width="calc(100% - 38px)">
|
||||
<MenuItemTitle tabIndex={0} width="calc(100% - 38px)">
|
||||
{item.sidebarLabel}
|
||||
{props.children}
|
||||
</MenuItemTitle>
|
||||
|
|
Loading…
Reference in New Issue
Block a user