fix(ui): make download button accessible via keyboard (#8974)
Refs #8881
This commit is contained in:
committed by
GitHub
parent
377b54a998
commit
c90ef50e73
@@ -45,18 +45,18 @@ const HighlightCode = ({value, fileName, className, downloadable, getConfigs, ca
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="highlight-code" ref={rootRef}>
|
<div className="highlight-code" ref={rootRef}>
|
||||||
{!downloadable ? null :
|
|
||||||
<div className="download-contents" onClick={handleDownload}>
|
|
||||||
Download
|
|
||||||
</div>
|
|
||||||
}
|
|
||||||
|
|
||||||
{canCopy && (
|
{canCopy && (
|
||||||
<div className="copy-to-clipboard">
|
<div className="copy-to-clipboard">
|
||||||
<CopyToClipboard text={value}><button/></CopyToClipboard>
|
<CopyToClipboard text={value}><button/></CopyToClipboard>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
|
{!downloadable ? null :
|
||||||
|
<button className="download-contents" onClick={handleDownload}>
|
||||||
|
Download
|
||||||
|
</button>
|
||||||
|
}
|
||||||
|
|
||||||
{canSyntaxHighlight
|
{canSyntaxHighlight
|
||||||
? <SyntaxHighlighter
|
? <SyntaxHighlighter
|
||||||
language={language}
|
language={language}
|
||||||
|
|||||||
@@ -745,10 +745,10 @@
|
|||||||
position: absolute;
|
position: absolute;
|
||||||
bottom: 10px;
|
bottom: 10px;
|
||||||
right: 10px;
|
right: 10px;
|
||||||
cursor: pointer;
|
|
||||||
background: #7d8293;
|
background: #7d8293;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
padding: 5px;
|
padding: 5px;
|
||||||
|
border: none;
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
font-family: sans-serif;
|
font-family: sans-serif;
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
|
|||||||
Reference in New Issue
Block a user