Skip to content

Commit 42c7ad6

Browse files
committed
Transform plotly.js title input into placeholder for multiformat text editor
1 parent 6c69983 commit 42c7ad6

File tree

3 files changed

+6
-9
lines changed

3 files changed

+6
-9
lines changed

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/components/fields/MultiFormatTextEditor.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,15 @@ import {connectToContainer} from 'lib';
66

77
export class UnconnectedMultiFormatTextEditor extends Component {
88
render() {
9+
const {multiValued, container} = this.props;
910
let fullValue = this.props.fullValue;
11+
1012
let placeholder;
11-
if (this.props.multiValued) {
13+
if (multiValued || !container.title) {
1214
placeholder = fullValue;
1315
fullValue = '';
1416
}
17+
1518
return (
1619
<Field {...this.props}>
1720
<MultiFormatTextEditor

src/components/widgets/text_editors/MultiFormatTextEditor.js

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -209,13 +209,7 @@ class MultiFormatTextEditor extends Component {
209209
return null;
210210
}
211211

212-
const {onChange, localize: _} = this.props;
213-
let {placeholder, value} = this.props;
214-
215-
if (value.startsWith('Click to enter') && value.endsWith('title')) {
216-
placeholder = `${value.replace('Click to enter', 'Enter')}`;
217-
value = '';
218-
}
212+
const {onChange, localize: _, placeholder, value} = this.props;
219213

220214
const {currentTab} = this.state;
221215

0 commit comments

Comments
 (0)