fix: allow easier selection of code blocks
Fixes: #652
Luke Karrys committed
Sep 29, 2023 at 12:11 UTC
ee55abb7497a26f868aa8f45f1e8e857c1ad8dce
1 file changed
+5
-1
theme/src/components/code.js
+5
-1
@@ -54,7 +54,11 @@ function Code({className, children, live, noinline}) {
54
{({className, style, tokens, getLineProps, getTokenProps}) => (
55
<BorderBox as="pre" className={className} mt={0} mb={3} p={3} border={0} style={{...style, overflow: 'auto'}}>
56
{/* This is the scroll handle, it is supposed to be focused with keyboard and scroll a wide codebox horizontally */}
57
- <div aria-hidden="true" style={{position: 'absolute', ...scrollSize}} ref={scrollHandleRef} />
57
+ <div
58
+ aria-hidden="true"
59
+ style={{visibility: 'hidden', position: 'absolute', ...scrollSize}}
60
+ ref={scrollHandleRef}
61
+ />
62
{tokens.map((line, i) => (
63
<div key={i} {...getLineProps({line, key: i})}>
64
{line.map((token, key) => (