diff options
Diffstat (limited to 'src/client/views/nodes/PhysicsBox/PhysicsSimulationInputField.tsx')
-rw-r--r-- | src/client/views/nodes/PhysicsBox/PhysicsSimulationInputField.tsx | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/client/views/nodes/PhysicsBox/PhysicsSimulationInputField.tsx b/src/client/views/nodes/PhysicsBox/PhysicsSimulationInputField.tsx index 1125e6020..cd55453ea 100644 --- a/src/client/views/nodes/PhysicsBox/PhysicsSimulationInputField.tsx +++ b/src/client/views/nodes/PhysicsBox/PhysicsSimulationInputField.tsx @@ -23,7 +23,7 @@ export interface IInputProps { } interface IState { - tempValue: number, + tempValue: string | number | (string|number)[], tempRadianValue: number, width: string; margin: string; @@ -71,7 +71,9 @@ export default class InputField extends React.Component<IInputProps, IState> { } else if (value < this.props.lowerBound) { value = this.props.lowerBound; } - this.props.dataDoc[this.props.prop] = value + if (this.props.prop != "") { + this.props.dataDoc[this.props.prop] = value + } this.setState({tempValue: event.target.value == "" ? event.target.value : value}) this.setState({tempRadianValue: (value * Math.PI) / 180}) if (this.props.effect) { @@ -85,8 +87,9 @@ export default class InputField extends React.Component<IInputProps, IState> { value = 2 * Math.PI; } else if (value < 0) { value = 0; + }if (this.props.prop != "") { + this.props.dataDoc[this.props.prop] = (value * 180) / Math.PI } - this.props.dataDoc[this.props.prop] = (value * 180) / Math.PI this.setState({tempValue: (value * 180) / Math.PI}) this.setState({tempRadianValue: value}) if (this.props.effect) { @@ -95,6 +98,7 @@ export default class InputField extends React.Component<IInputProps, IState> { }; render () { + return ( <div style={{ display: "flex", @@ -174,5 +178,6 @@ export default class InputField extends React.Component<IInputProps, IState> { /> )} </div> + ) } }; |