diff --git a/web/app/components/input/input.jsx b/web/app/components/input/input.jsx index cbce5e05..32c0b437 100644 --- a/web/app/components/input/input.jsx +++ b/web/app/components/input/input.jsx @@ -29,7 +29,7 @@ export default class Input extends Component { } componentDidMount() { - const { mods = {} } = this.props; + const { mods = {}, value } = this.props; if (this.props.autoFocus) { this.fieldNode.focus(); @@ -38,6 +38,7 @@ export default class Input extends Component { if (mods.mode !== 'edit') { this.fieldNode.value = ''; } else { + this.fieldNode.value = value; this.autoResize(); } @@ -46,6 +47,10 @@ export default class Input extends Component { }); } + componentWillUnmount() { + this.fieldNode.value = ''; + } + shouldComponentUpdate(nextProps) { return nextProps.id !== this.props.id || nextProps.pid !== this.props.pid