You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-11-14 19:02:33 +03:00
incorporate kegan PR feedback
This commit is contained in:
@@ -41,9 +41,6 @@ module.exports = React.createClass({
|
||||
Edit: "edit",
|
||||
},
|
||||
|
||||
value: '',
|
||||
placeholder: false,
|
||||
|
||||
getDefaultProps: function() {
|
||||
return {
|
||||
onValueChanged: function() {},
|
||||
@@ -69,6 +66,13 @@ module.exports = React.createClass({
|
||||
}
|
||||
},
|
||||
|
||||
componentWillMount: function() {
|
||||
// we track value as an JS object field rather than in React state
|
||||
// as React doesn't play nice with contentEditable.
|
||||
this.value = '';
|
||||
this.placeholder = false;
|
||||
},
|
||||
|
||||
componentDidMount: function() {
|
||||
this.value = this.props.initialValue;
|
||||
if (this.refs.editable_div) {
|
||||
@@ -76,9 +80,6 @@ module.exports = React.createClass({
|
||||
}
|
||||
},
|
||||
|
||||
componentDidUpdate: function() {
|
||||
},
|
||||
|
||||
showPlaceholder: function(show) {
|
||||
if (show) {
|
||||
this.refs.editable_div.textContent = this.props.placeholder;
|
||||
|
||||
Reference in New Issue
Block a user