I'm trying to restrict an input to integers. I'm trying to pass the step attribute which seems to work when used directly in HTML, but am having a hard time getting having it passed from react. Below is my render method, and the numeric input is down at the bottom. The problem I'm having is the input is still accepting decimal.
render() {
const {
currentVariableValue,
type,
currentVariable,
variablePayload,
} = this.props
const lowHi = this.getLowHi()
const lowHiDisplay = `between ${lowHi[0]} and ${lowHi[1]}`
/* eslint-disable no-nested-ternary */
return (
<ResponseContainer>
{
type === 'text' ?
<TransparentTextArea
autoFocus
type="text"
value={ currentVariableValue }
onChange={ this.handleUpdateValue }
onFocus={ this.handleFocus }
onKeyPress={ this.handleKeyPress }
key={ currentVariable }
/> :
type === 'paragraph' ?
<TransparentTextArea
autoFocus
type="text"
value={ currentVariableValue }
onChange={ this.handleUpdateValue }
onFocus={ this.handleFocus }
onKeyPress={ this.handleKeyPress }
key={ currentVariable }
style={ { height: '300px', width: '95%', fontSize: '1.4em' } }
/> :
<TransparentInput
autoFocus
type="numeric"
value={ currentVariableValue }
onChange={ this.handleUpdateValue }
onFocus={ this.handleFocus }
onKeyPress={ this.handleKeyPress }
key={ currentVariable }
invalid={ !variablePayload.isValid }
step={ 1 }
/>
}