1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-07-24 15:59:41 +02:00

fix(ui/code-editor): stretch code editor content full height [EE-5202] (#8673)

This commit is contained in:
Chaim Lev-Ari 2023-03-30 12:26:32 +03:00 committed by GitHub
parent 7f805ac5be
commit d64e7eacfc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
20 changed files with 60 additions and 57 deletions

View file

@ -70,3 +70,7 @@
background-color: var(--bg-inputbox);
color: var(--text-form-control-color);
}
.root :global(.cm-content[contenteditable='true']) {
@apply h-full;
}

View file

@ -6,6 +6,7 @@ import { createTheme } from '@uiw/codemirror-themes';
import { tags as highlightTags } from '@lezer/highlight';
import styles from './CodeEditor.module.css';
import { TextTip } from './Tip/TextTip';
interface Props {
id: string;
@ -53,16 +54,18 @@ export function CodeEditor({
const extensions = useMemo(() => (isYaml ? [yamlLanguage] : []), [isYaml]);
return (
<CodeMirror
className={styles.root}
theme={theme}
value={value}
onChange={onChange}
readOnly={readonly}
placeholder={placeholder}
id={id}
extensions={extensions}
height={height}
/>
<>
{!!placeholder && <TextTip color="blue">{placeholder}</TextTip>}
<CodeMirror
className={styles.root}
theme={theme}
value={value}
onChange={onChange}
readOnly={readonly}
id={id}
extensions={extensions}
height={height}
/>
</>
);
}