Skip to content

Commit cba21ff

Browse files
makhmudjon-inadullaevMakhmudjon Inadullaev
andauthored
Eslint issues fixed: (npm#458)
* Eslint issues fixed: - jsx-a11y/no-noninteractive-tabindex - jsx-a11y/click-events-have-key-events - jsx-a11y/no-static-element-interactions * Fix for font aligns * drawer button font sizes updated --------- Co-authored-by: Makhmudjon Inadullaev <makhmudjon-inadullaev@gmail.com>
1 parent c0408b7 commit cba21ff

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

theme/src/components/code.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,7 @@ function Code({className, children, live, noinline}) {
2828
{({className, style, tokens, getLineProps, getTokenProps}) => (
2929
<BorderBox as="pre" className={className} mt={0} mb={3} p={3} border={0} style={{...style, overflow: 'auto'}}>
3030
{/* This is the scroll handle, it is supposed to be focused with keyboard and scroll a wide codebox horizontally */}
31-
{/* eslint-disable-next-line jsx-a11y/no-noninteractive-tabindex */}
32-
<div aria-hidden="true" tabIndex={0} style={scrollHandleStyle} ref={scrollHandleRef} aria-label={code}>
31+
<div aria-hidden="true" style={scrollHandleStyle} ref={scrollHandleRef} aria-label={code}>
3332
&nbsp;
3433
</div>
3534
{tokens.map((line, i) => (

theme/src/components/drawer.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ function Drawer({isOpen, onDismiss, children}) {
77
return (
88
<AnimatePresence>
99
{isOpen ? (
10-
// eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions
11-
<div
10+
<button
1211
// These event handlers fix a bug that caused links below the fold
1312
// to be unclickable in macOS Safari.
1413
// Reference: https://github.com/theKashey/react-focus-lock/issues/79
14+
style={{ textAlign: 'start', fontSize: '1rem', lineHeight: '1.5rem' }}
1515
onMouseDown={event => event.preventDefault()}
1616
onClick={event => event.target.focus()}
1717
>
@@ -30,7 +30,6 @@ function Drawer({isOpen, onDismiss, children}) {
3030
bg="rgba(0, 0, 0, 0.5)"
3131
onClick={() => onDismiss()}
3232
/>
33-
3433
<Fixed
3534
key="drawer"
3635
as={motion.div}
@@ -48,7 +47,7 @@ function Drawer({isOpen, onDismiss, children}) {
4847
{children}
4948
</Fixed>
5049
</FocusOn>
51-
</div>
50+
</button>
5251
) : null}
5352
</AnimatePresence>
5453
)

0 commit comments

Comments
 (0)