Fix scrolling over code examples

This commit is contained in:
2025-02-22 23:56:47 -06:00
parent 9f1498b3ad
commit 26e9a7addf
3 changed files with 6 additions and 10 deletions
+3 -2
View File
@@ -6,12 +6,13 @@ import styles from './CodeExample.module.css';
type CodeExampleProps = {
code: string;
height?: string | number;
noScroll?: boolean;
}
export default function CodeExample({ code, height = "100%" }: CodeExampleProps) {
export default function CodeExample({ code, height = "100%", noScroll = false }: CodeExampleProps) {
return (
<div className={styles.editorWrapper}>
<div className={styles.editorContainer}>
<div className={styles.editorContainer} style={{ pointerEvents: noScroll ? 'none' : 'auto' }}>
<Editor
height={height}
defaultLanguage="typescript"