Slider prop error fix (#743)

* Cast to float.

* Force gas price and limit inputs to be numbers.
This commit is contained in:
William O'Beirne 2018-01-08 00:30:56 -05:00 committed by Daniel Ternyak
parent ce3b513354
commit 62381427e4
2 changed files with 3 additions and 1 deletions

View File

@ -19,6 +19,7 @@ export default class AdvancedGas extends React.Component<Props> {
<label>{translate('OFFLINE_Step2_Label_3')} (gwei)</label> <label>{translate('OFFLINE_Step2_Label_3')} (gwei)</label>
<input <input
className="form-control" className="form-control"
type="number"
value={this.props.gasPrice} value={this.props.gasPrice}
onChange={this.handleGasPriceChange} onChange={this.handleGasPriceChange}
/> />
@ -28,6 +29,7 @@ export default class AdvancedGas extends React.Component<Props> {
<label>{translate('OFFLINE_Step2_Label_4')}</label> <label>{translate('OFFLINE_Step2_Label_4')}</label>
<input <input
className="form-control" className="form-control"
type="number"
value={this.props.gasLimit} value={this.props.gasLimit}
onChange={this.handleGasLimitChange} onChange={this.handleGasLimitChange}
/> />

View File

@ -26,7 +26,7 @@ export default class SimpleGas extends React.Component<Props> {
onChange={this.handleSlider} onChange={this.handleSlider}
min={gasPriceDefaults.gasPriceMinGwei} min={gasPriceDefaults.gasPriceMinGwei}
max={gasPriceDefaults.gasPriceMaxGwei} max={gasPriceDefaults.gasPriceMaxGwei}
value={gasPrice} value={parseFloat(gasPrice)}
/> />
<div className="SimpleGas-slider-labels"> <div className="SimpleGas-slider-labels">
<span>{translate('Cheap')}</span> <span>{translate('Cheap')}</span>