mirror of
https://github.com/Redocly/redoc.git
synced 2024-11-22 08:36:33 +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() {
|
render() {
|
||||||
const { item, withoutChildren } = this.props;
|
const { item, withoutChildren } = this.props;
|
||||||
return (
|
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' ? (
|
{item.type === 'operation' ? (
|
||||||
<OperationMenuItemContent {...this.props} item={item as OperationModel} />
|
<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>
|
<OperationBadge type={item.httpVerb}>{shortenHTTPVerb(item.httpVerb)}</OperationBadge>
|
||||||
)}
|
)}
|
||||||
<MenuItemTitle width="calc(100% - 38px)">
|
<MenuItemTitle tabIndex={0} width="calc(100% - 38px)">
|
||||||
{item.sidebarLabel}
|
{item.sidebarLabel}
|
||||||
{props.children}
|
{props.children}
|
||||||
</MenuItemTitle>
|
</MenuItemTitle>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user