mirror of
https://github.com/facebook/docusaurus.git
synced 2025-06-14 00:32:47 +02:00
fix(v2): improve code block scroll accessibility (#2476)
This commit is contained in:
parent
cffb3f9af5
commit
cf884f532d
2 changed files with 6 additions and 0 deletions
|
@ -5,6 +5,8 @@
|
|||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
/* eslint-disable jsx-a11y/no-noninteractive-tabindex */
|
||||
|
||||
import React, {useEffect, useState, useRef} from 'react';
|
||||
import classnames from 'classnames';
|
||||
import Highlight, {defaultProps} from 'prism-react-renderer';
|
||||
|
@ -117,6 +119,7 @@ export default ({children, className: languageClassName, metastring}) => {
|
|||
{showCopied ? 'Copied' : 'Copy'}
|
||||
</button>
|
||||
<pre
|
||||
tabIndex="0"
|
||||
className={classnames(className, styles.codeBlock, {
|
||||
[styles.codeBlockWithTitle]: codeBlockTitle,
|
||||
})}>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue