mirror of
https://github.com/ascribe/onion.git
synced 2024-12-23 01:39:36 +01:00
Property:
- update initialValue when Property has been save successfully to enable consecutive cancel + save actions Private Note: - Made private note non-required
This commit is contained in:
parent
d0e5fe50cb
commit
550a2d9e58
@ -328,8 +328,7 @@ let EditionPersonalNote = React.createClass({
|
|||||||
rows={1}
|
rows={1}
|
||||||
editable={true}
|
editable={true}
|
||||||
defaultValue={this.props.edition.note_from_user}
|
defaultValue={this.props.edition.note_from_user}
|
||||||
placeholder={getLangText('Enter a personal note%s', '...')}
|
placeholder={getLangText('Enter a personal note%s', '...')}/>
|
||||||
required="required"/>
|
|
||||||
</Property>
|
</Property>
|
||||||
<Property hidden={true} name='bitcoin_id'>
|
<Property hidden={true} name='bitcoin_id'>
|
||||||
<input defaultValue={this.props.edition.bitcoin_id}/>
|
<input defaultValue={this.props.edition.bitcoin_id}/>
|
||||||
|
@ -57,13 +57,15 @@ let Property = React.createClass({
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
this.setState({
|
if(!this.state.initialValue) {
|
||||||
initialValue: this.refs.input.getDOMNode().defaultValue
|
this.setState({
|
||||||
});
|
initialValue: this.refs.input.getDOMNode().defaultValue
|
||||||
|
});
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
reset(){
|
reset(){
|
||||||
// maybe do reset by reload instead of frontend state?
|
// maybe do reset by reload instead of front end state?
|
||||||
this.setState({value: this.state.initialValue});
|
this.setState({value: this.state.initialValue});
|
||||||
if (this.refs.input.state){
|
if (this.refs.input.state){
|
||||||
// This is probably not the right way but easy fix
|
// This is probably not the right way but easy fix
|
||||||
@ -117,7 +119,10 @@ let Property = React.createClass({
|
|||||||
handleSuccess(){
|
handleSuccess(){
|
||||||
this.setState({
|
this.setState({
|
||||||
isFocused: false,
|
isFocused: false,
|
||||||
errors: null
|
errors: null,
|
||||||
|
|
||||||
|
// also update initialValue in case of the user updating and canceling its actions again
|
||||||
|
initialValue: this.refs.input.getDOMNode().value
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user