mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Fixed NaN issue when parsing
This commit is contained in:
parent
38c0e91666
commit
f16a2c0f48
@ -95,10 +95,12 @@ export class ThresholdsEditor extends PureComponent<Props, State> {
|
||||
}
|
||||
|
||||
const { thresholds } = this.state;
|
||||
const parsedValue = parseInt(event.target.value, 10);
|
||||
const value = isNaN(parsedValue) ? null : parsedValue;
|
||||
|
||||
const newThresholds = thresholds.map(t => {
|
||||
if (t === threshold) {
|
||||
t = { ...t, value: parseInt(event.target.value, 10) };
|
||||
t = { ...t, value: value as number };
|
||||
}
|
||||
|
||||
return t;
|
||||
|
Loading…
Reference in New Issue
Block a user