Skip to content

Commit

Permalink
fix - exchange validation input number with more than 2 decimals on F…
Browse files Browse the repository at this point in the history
…irefox.
  • Loading branch information
Lyncee59 committed May 29, 2018
1 parent 6821535 commit f963d93
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
6 changes: 4 additions & 2 deletions packages/blockchain-info-components/src/Form/NumberInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,15 @@ const NumberInput = props => {
NumberInput.propTypes = {
disabled: PropTypes.bool,
height: PropTypes.string,
minHeight: PropTypes.string
minHeight: PropTypes.string,
step: PropTypes.string
}

NumberInput.defaultProps = {
disabled: false,
height: '40px',
minHeight: '40px'
minHeight: '40px',
step: '0.01'
}

export default NumberInput
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class NumberBoxDebounced extends React.Component {
}

render () {
const { meta, disabled, placeholder } = this.props
const { meta, disabled, placeholder, ...rest } = this.props
const errorState = getErrorState(meta)

return (
Expand All @@ -77,6 +77,7 @@ class NumberBoxDebounced extends React.Component {
onChange={this.handleChange}
onFocus={this.handleFocus}
onBlur={this.handleBlur}
{...rest}
/>
{meta.touched && meta.error && <Error size='12px' weight={300} color='error'>{meta.error}</Error>}
</Container>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ const Success = props => {
<Row height='80px'>
<Cell>
<AmountContainer hasNoBottomBorder>
<Field name='sourceAmount' component={NumberBoxDebounced} disabled={disabled} />
<Field name='sourceAmount' component={NumberBoxDebounced} disabled={disabled} step='0.00000001' />
<CurrencyBox disabled={disabled}>{sourceCoin}</CurrencyBox>
</AmountContainer>
<AmountContainer>
Expand All @@ -141,7 +141,7 @@ const Success = props => {
</Cell>
<Cell>
<AmountContainer hasNoBottomBorder>
<Field name='targetAmount' component={NumberBoxDebounced} disabled={disabled} />
<Field name='targetAmount' component={NumberBoxDebounced} disabled={disabled} step='0.00000001' />
<CurrencyBox disabled={disabled}>{targetCoin}</CurrencyBox>
</AmountContainer>
<AmountContainer>
Expand Down

0 comments on commit f963d93

Please sign in to comment.