Skip to content

Commit

Permalink
fix(v2): improve code block scroll accessibility (#2476)
Browse files Browse the repository at this point in the history
  • Loading branch information
lex111 authored Mar 29, 2020
1 parent cffb3f9 commit cf884f5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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,
})}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -136,6 +138,7 @@ export default ({
{showCopied ? 'Copied' : 'Copy'}
</button>
<pre
tabIndex="0"
className={classnames(className, styles.codeBlock, {
[styles.codeBlockWithTitle]: codeBlockTitle,
})}>
Expand Down

0 comments on commit cf884f5

Please sign in to comment.