mirror of
https://github.com/Redocly/redoc.git
synced 2024-11-10 19:06:34 +03:00
fix: make sample controls focusable
This commit is contained in:
parent
05fd7543a2
commit
006031c517
|
@ -34,14 +34,14 @@ export class CopyButtonWrapper extends React.PureComponent<
|
|||
|
||||
renderCopyButton = () => {
|
||||
return (
|
||||
<span onClick={this.copy}>
|
||||
<button onClick={this.copy}>
|
||||
<Tooltip
|
||||
title={ClipboardService.isSupported() ? 'Copied' : 'Not supported in your browser'}
|
||||
open={this.state.tooltipShown}
|
||||
>
|
||||
Copy
|
||||
</Tooltip>
|
||||
</span>
|
||||
</button>
|
||||
);
|
||||
};
|
||||
|
||||
|
|
|
@ -6,12 +6,19 @@ export const SampleControls = styled.div`
|
|||
transition: opacity 0.3s ease;
|
||||
text-align: right;
|
||||
|
||||
> span {
|
||||
display: inline-block;
|
||||
> button {
|
||||
background-color: transparent;
|
||||
border: 0;
|
||||
color: inherit;
|
||||
padding: 2px 10px;
|
||||
font-family: ${({ theme }) => theme.typography.fontFamily};
|
||||
font-size: ${({ theme }) => theme.typography.fontSize};
|
||||
line-height: ${({ theme }) => theme.typography.lineHeight};
|
||||
cursor: pointer;
|
||||
outline: 0;
|
||||
|
||||
:hover {
|
||||
:hover,
|
||||
:focus {
|
||||
background: rgba(255, 255, 255, 0.1);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -30,8 +30,8 @@ class Json extends React.PureComponent<JsonProps> {
|
|||
<JsonViewerWrap>
|
||||
<SampleControls>
|
||||
{renderCopyButton()}
|
||||
<span onClick={this.expandAll}> Expand all </span>
|
||||
<span onClick={this.collapseAll}> Collapse all </span>
|
||||
<button onClick={this.expandAll}> Expand all </button>
|
||||
<button onClick={this.collapseAll}> Collapse all </button>
|
||||
</SampleControls>
|
||||
<OptionsContext.Consumer>
|
||||
{options => (
|
||||
|
|
Loading…
Reference in New Issue
Block a user