Fix FillQuery interpretation of number values

pull/10616/head
Jared Scheib 2017-08-29 15:32:47 -07:00
parent a980706304
commit 61e4b4bfec
1 changed files with 11 additions and 10 deletions

View File

@ -9,16 +9,17 @@ class FillQuery extends Component {
constructor(props) {
super(props)
this.state =
typeof props.value === NUMBER
? {
selected: queryFills.find(fill => fill.type === NUMBER),
numberValue: props.value,
}
: {
selected: queryFills.find(fill => fill.type === props.value),
numberValue: '0',
}
const isNumberValue = !isNaN(Number(props.value))
this.state = isNumberValue
? {
selected: queryFills.find(fill => fill.type === NUMBER),
numberValue: props.value,
}
: {
selected: queryFills.find(fill => fill.type === props.value),
numberValue: '0',
}
}
static defaultProps = {