mirror of
https://github.com/xodio/xod.git
synced 2026-03-24 17:46:56 +01:00
tweak(xod-client): add optional ‘forceCommit’ flag to Widget’s updateValue
It’s quite useful in hotkey handlers
This commit is contained in:
@@ -59,10 +59,9 @@ class Widget extends React.Component {
|
||||
}
|
||||
}
|
||||
|
||||
updateValue(value) {
|
||||
const commitCallback = this.props.commitOnChange
|
||||
? this.commit.bind(this)
|
||||
: noop;
|
||||
updateValue(value, forceCommit = false) {
|
||||
const commitCallback =
|
||||
this.props.commitOnChange || forceCommit ? this.commit.bind(this) : noop;
|
||||
|
||||
this.setState({ value }, commitCallback);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user