|
@@ -4,13 +4,13 @@ import { PropertyChangedEvent } from "../../propertyChangedEvent";
|
|
|
import { LockObject } from "../tabs/propertyGrids/lockObject";
|
|
|
|
|
|
interface IFloatLineComponentProps {
|
|
|
- label: string,
|
|
|
- target: any,
|
|
|
- propertyName: string,
|
|
|
- lockObject?: LockObject,
|
|
|
- onChange?: (newValue: number) => void,
|
|
|
- onPropertyChangedObservable?: Observable<PropertyChangedEvent>,
|
|
|
- additionalClass?: string
|
|
|
+ label: string;
|
|
|
+ target: any;
|
|
|
+ propertyName: string;
|
|
|
+ lockObject?: LockObject;
|
|
|
+ onChange?: (newValue: number) => void;
|
|
|
+ onPropertyChangedObservable?: Observable<PropertyChangedEvent>;
|
|
|
+ additionalClass?: string;
|
|
|
}
|
|
|
|
|
|
export class FloatLineComponent extends React.Component<IFloatLineComponentProps, { value: string }> {
|
|
@@ -21,11 +21,10 @@ export class FloatLineComponent extends React.Component<IFloatLineComponentProps
|
|
|
super(props);
|
|
|
|
|
|
let currentValue = this.props.target[this.props.propertyName];
|
|
|
- this.state = { value: currentValue ? currentValue.toFixed(3) : "0" }
|
|
|
+ this.state = { value: currentValue ? currentValue.toFixed(3) : "0" };
|
|
|
this._store = currentValue;
|
|
|
}
|
|
|
|
|
|
-
|
|
|
componentWillUnmount() {
|
|
|
this.unlock();
|
|
|
}
|
|
@@ -100,7 +99,7 @@ export class FloatLineComponent extends React.Component<IFloatLineComponentProps
|
|
|
{this.props.label}
|
|
|
</div>
|
|
|
<div className="value">
|
|
|
- <input className="numeric-input" value={this.state.value} onBlur={() => this.unlock()} onFocus={() => this.lock()} onChange={evt => this.updateValue(evt.target.value)} />
|
|
|
+ <input className="numeric-input" value={this.state.value} onBlur={() => this.unlock()} onFocus={() => this.lock()} onChange={(evt) => this.updateValue(evt.target.value)} />
|
|
|
</div>
|
|
|
</div>
|
|
|
);
|