Merge pull request #4956 from bacteriostat/feature/single-line-editor-placeholder

feat: Add placeholder for SingleLineEditor
This commit is contained in:
Bacteria
2025-06-25 10:30:22 +00:00
committed by GitHub
parent 92a0f093db
commit 6244679d5b
4 changed files with 14 additions and 0 deletions

View File

@@ -26,6 +26,11 @@ const StyledWrapper = styled.div`
.CodeMirror-lines {
padding: 0;
.CodeMirror-placeholder {
color: ${(props) => props.theme.codemirror.placeholder.color} !important;
opacity: ${(props) => props.theme.codemirror.placeholder.opacity} !important
}
}
.CodeMirror-cursor {

View File

@@ -46,6 +46,7 @@ class SingleLineEditor extends Component {
const noopHandler = () => {};
this.editor = CodeMirror(this.editorRef.current, {
placeholder: this.props.placeholder ?? '',
lineWrapping: false,
lineNumbers: false,
theme: this.props.theme === 'dark' ? 'monokai' : 'default',