mirror of
https://github.com/Alamantus/Lexiconga.git
synced 2025-06-18 23:26:39 +02:00
Fix word form not clearing
This commit is contained in:
parent
3625317b15
commit
74956c06f6
2 changed files with 9 additions and 4 deletions
|
@ -25,6 +25,12 @@ export class IPAField extends Component {
|
||||||
this.field = null;
|
this.field = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
componentWillReceiveProps (nextProps) {
|
||||||
|
this.setState({
|
||||||
|
value: nextProps.value
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
showHelp () {
|
showHelp () {
|
||||||
if (this.state.doShowHelp) {
|
if (this.state.doShowHelp) {
|
||||||
return (
|
return (
|
||||||
|
|
|
@ -98,7 +98,7 @@ export class WordForm extends Component {
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<IPAField
|
<IPAField value={this.state.wordPronunciation}
|
||||||
onChange={newValue => this.setState({ wordPronunciation: newValue })} />
|
onChange={newValue => this.setState({ wordPronunciation: newValue })} />
|
||||||
|
|
||||||
<div className='field'>
|
<div className='field'>
|
||||||
|
@ -143,11 +143,10 @@ export class WordForm extends Component {
|
||||||
<p className='control'>
|
<p className='control'>
|
||||||
<textarea className={`textarea${(!this.state.detailsIsValid) ? ' is-danger' : ''}`}
|
<textarea className={`textarea${(!this.state.detailsIsValid) ? ' is-danger' : ''}`}
|
||||||
placeholder='Explanation of word (Markdown enabled)'
|
placeholder='Explanation of word (Markdown enabled)'
|
||||||
|
value={this.state.wordDetails}
|
||||||
onChange={(event) => {
|
onChange={(event) => {
|
||||||
this.setState({ wordDetails: event.target.value });
|
this.setState({ wordDetails: event.target.value });
|
||||||
}}>
|
}} />
|
||||||
{this.state.wordDetails}
|
|
||||||
</textarea>
|
|
||||||
{(!this.state.detailsIsValid)
|
{(!this.state.detailsIsValid)
|
||||||
? (
|
? (
|
||||||
<span className='help is-danger'>
|
<span className='help is-danger'>
|
||||||
|
|
Loading…
Add table
Reference in a new issue