From 2845498ef0aa41b7a21866062b3d6583d760879e Mon Sep 17 00:00:00 2001 From: brynnchernosky <56202540+brynnchernosky@users.noreply.github.com> Date: Mon, 1 May 2023 19:38:04 -0400 Subject: debugging --- .../nodes/PhysicsBox/PhysicsSimulationInputField.tsx | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'src/client/views/nodes/PhysicsBox/PhysicsSimulationInputField.tsx') diff --git a/src/client/views/nodes/PhysicsBox/PhysicsSimulationInputField.tsx b/src/client/views/nodes/PhysicsBox/PhysicsSimulationInputField.tsx index 75bc28919..f3491fbd6 100644 --- a/src/client/views/nodes/PhysicsBox/PhysicsSimulationInputField.tsx +++ b/src/client/views/nodes/PhysicsBox/PhysicsSimulationInputField.tsx @@ -25,6 +25,8 @@ export interface IInputProps { interface IState { tempValue: number, tempRadianValue: number, + width: string; + margin: string; } export default class InputField extends React.Component { @@ -32,17 +34,16 @@ export default class InputField extends React.Component { super(props) this.state = { tempValue: this.props.mode != "Freeform" && !this.props.showIcon ? 0 : this.props.value, - tempRadianValue: this.props.mode != "Freeform" && !this.props.showIcon ? 0 : (Number(this.props.value) * Math.PI) / 180 + tempRadianValue: this.props.mode != "Freeform" && !this.props.showIcon ? 0 : (Number(this.props.value) * Math.PI) / 180, + width: this.props.small ? "6em" : "7em", + margin: this.props.small ? "0px" : "10px" + } } epsilon: number = 0; - width: string = "6em"; - margin: string = "6em"; componentDidMount() { this.epsilon = 0.01; - this.width = this.props.small ? "6em" : "7em"; - this.margin = this.props.small ? "0px" : "10px"; } componentDidUpdate(prevProps: Readonly, prevState: Readonly, snapshot?: any): void { @@ -120,8 +121,8 @@ export default class InputField extends React.Component { onChange={this.onChange} sx={{ height: "1em", - width: { this.width }, - marginLeft: { this.margin }, + width: this.state.width, + marginLeft: this.state.margin, zIndex: "modal", }} inputProps={{ @@ -157,8 +158,8 @@ export default class InputField extends React.Component { onChange={this.onChangeRadianValue} sx={{ height: "1em", - width: { this.width }, - marginLeft: { this.margin }, + width: this.state.width, + marginLeft: this.state.margin, zIndex: "modal", }} inputProps={{ -- cgit v1.2.3-70-g09d2