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:
parent
7f805ac5be
commit
d64e7eacfc
20 changed files with 60 additions and 57 deletions
|
@ -70,3 +70,7 @@
|
|||
background-color: var(--bg-inputbox);
|
||||
color: var(--text-form-control-color);
|
||||
}
|
||||
|
||||
.root :global(.cm-content[contenteditable='true']) {
|
||||
@apply h-full;
|
||||
}
|
||||
|
|
|
@ -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}
|
||||
/>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue