0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2025-01-27 21:39:16 -05:00

refactor(console): remove min-height for readonly code editors (#4350)

This commit is contained in:
Gao Sun 2023-08-17 10:37:43 +08:00 committed by GitHub
parent 758510a13f
commit c4a9246071
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 5 deletions

View file

@ -59,10 +59,12 @@
overflow: hidden;
}
textarea,
pre {
display: flex;
min-height: 80px;
&:not(.readonly) {
textarea,
pre {
display: flex;
min-height: 80px;
}
}
}

View file

@ -87,7 +87,7 @@ function CodeEditor({
<div className={classNames(styles.container, className)}>
{isShowingPlaceholder && <div className={styles.placeholder}>{placeholder}</div>}
<CopyToClipboard value={value ?? ''} variant="icon" className={styles.copy} />
<div ref={editorRef} className={styles.editor}>
<div ref={editorRef} className={classNames(styles.editor, isReadonly && styles.readonly)}>
{/* SyntaxHighlighter is a readonly component, so a transparent <textarea> layer is needed
in order to support user interactions, such as code editing, copy-pasting, etc. */}
<textarea