Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

fix: make download button accessible via keyboard #8974

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions src/core/components/highlight-code.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,18 +45,18 @@ const HighlightCode = ({value, fileName, className, downloadable, getConfigs, ca

return (
<div className="highlight-code" ref={rootRef}>
{!downloadable ? null :
<div className="download-contents" onClick={handleDownload}>
Download
</div>
}

{canCopy && (
<div className="copy-to-clipboard">
<CopyToClipboard text={value}><button/></CopyToClipboard>
</div>
)}

{!downloadable ? null :
<button className="download-contents" onClick={handleDownload}>
Download
</button>
}

{canSyntaxHighlight
? <SyntaxHighlighter
language={language}
Expand Down
2 changes: 1 addition & 1 deletion src/style/_layout.scss
Original file line number Diff line number Diff line change
Expand Up @@ -745,10 +745,10 @@
position: absolute;
bottom: 10px;
right: 10px;
cursor: pointer;
background: #7d8293;
text-align: center;
padding: 5px;
border: none;
border-radius: 4px;
font-family: sans-serif;
font-weight: 600;
Expand Down