Fix word form not clearing
This commit is contained in:
parent
3625317b15
commit
74956c06f6
|
@ -25,6 +25,12 @@ export class IPAField extends Component {
|
|||
this.field = null;
|
||||
}
|
||||
|
||||
componentWillReceiveProps (nextProps) {
|
||||
this.setState({
|
||||
value: nextProps.value
|
||||
});
|
||||
}
|
||||
|
||||
showHelp () {
|
||||
if (this.state.doShowHelp) {
|
||||
return (
|
||||
|
|
|
@ -98,7 +98,7 @@ export class WordForm extends Component {
|
|||
</p>
|
||||
</div>
|
||||
|
||||
<IPAField
|
||||
<IPAField value={this.state.wordPronunciation}
|
||||
onChange={newValue => this.setState({ wordPronunciation: newValue })} />
|
||||
|
||||
<div className='field'>
|
||||
|
@ -143,11 +143,10 @@ export class WordForm extends Component {
|
|||
<p className='control'>
|
||||
<textarea className={`textarea${(!this.state.detailsIsValid) ? ' is-danger' : ''}`}
|
||||
placeholder='Explanation of word (Markdown enabled)'
|
||||
value={this.state.wordDetails}
|
||||
onChange={(event) => {
|
||||
this.setState({ wordDetails: event.target.value });
|
||||
}}>
|
||||
{this.state.wordDetails}
|
||||
</textarea>
|
||||
}} />
|
||||
{(!this.state.detailsIsValid)
|
||||
? (
|
||||
<span className='help is-danger'>
|
||||
|
|
Loading…
Reference in New Issue