mirror of
https://github.com/xodio/xod.git
synced 2026-03-23 17:16:53 +01:00
tweak(xod-client): remove redundant state part in Widget component
This commit is contained in:
@@ -14,10 +14,10 @@ export default function composeWidget(Component, widgetProps) {
|
||||
this.commit();
|
||||
},
|
||||
[KEYCODE.ESCAPE]: function escape(event) {
|
||||
if (this.state.value === this.state.initialValue) {
|
||||
if (this.state.value === this.parseValue(this.props.value)) {
|
||||
event.target.blur();
|
||||
} else {
|
||||
this.updateValue(this.state.initialValue);
|
||||
this.updateValue(this.props.value);
|
||||
}
|
||||
},
|
||||
};
|
||||
@@ -30,7 +30,6 @@ export default function composeWidget(Component, widgetProps) {
|
||||
|
||||
const val = this.parseValue(props.value);
|
||||
this.state = {
|
||||
initialValue: val,
|
||||
value: val,
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user