added placeholder support to MultiLineEditor component

This commit is contained in:
busy-panda 2024-04-19 15:01:41 +02:00
parent 39f60daca7
commit c3c91d61c8
5 changed files with 17 additions and 0 deletions

View File

@ -13,6 +13,12 @@ const StyledWrapper = styled.div`
line-height: 30px;
overflow: hidden;
pre.CodeMirror-placeholder {
color: ${(props) => props.theme.text};
padding-left: 0;
opacity: 0.5;
}
.CodeMirror-scroll {
overflow: hidden !important;
${'' /* padding-bottom: 50px !important; */}

View File

@ -28,6 +28,7 @@ class MultiLineEditor extends Component {
lineWrapping: false,
lineNumbers: false,
theme: this.props.theme === 'dark' ? 'monokai' : 'default',
placeholder: this.props.placeholder,
mode: 'brunovariables',
brunoVarInfo: {
variables: getAllVariables(this.props.collection)

View File

@ -24,6 +24,14 @@ const Wrapper = styled.div`
width: 30%;
}
&:nth-child(2) {
width: 45%;
}
&:nth-child(3) {
width: 25%;
}
&:nth-child(4) {
width: 70px;
}

View File

@ -151,6 +151,7 @@ const MultipartFormParams = ({ item, collection }) => {
<MultiLineEditor
onSave={onSave}
theme={storedTheme}
placeholder="Auto"
value={param.contentType}
onChange={(newValue) =>
handleParamChange(

View File

@ -31,6 +31,7 @@ if (!SERVER_RENDERED) {
require('codemirror/addon/search/jump-to-line');
require('codemirror/addon/search/search');
require('codemirror/addon/search/searchcursor');
require('codemirror/addon/display/placeholder');
require('codemirror/keymap/sublime');
require('codemirror-graphql/hint');