mirror of
https://github.com/jaronpate/unicord.git
synced 2026-10-18 21:47:40 +00:00
Fix scrolling over code examples
This commit is contained in:
@@ -11,10 +11,5 @@
|
||||
overflow: hidden;
|
||||
border: 1px solid #2d2d2d;
|
||||
/* Prevent scroll capture */
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
/* Re-enable pointer events only for the Monaco Editor */
|
||||
.editorContainer :global(.monaco-editor) {
|
||||
pointer-events: auto;
|
||||
/* pointer-events: none; */
|
||||
}
|
||||
|
||||
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user