Skip to content

Commit 993b3ce

Browse files
committed
fix value=0 initialization for Gauge and Knob
1 parent 420a57f commit 993b3ce

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/components/Gauge.react.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ class Gauge extends React.Component {
3939

4040
const colorValue = getColorValue(color);
4141

42-
const rawValue = this.props.value || min;
42+
const rawValue = this.props.value != null ? this.props.value : min;
4343
const dirtyValue = logarithmic ? log.compute(rawValue) : rawValue;
4444
const value = sanitizeRangeValue({ min, max, value: dirtyValue });
4545

src/components/Knob.react.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class Knob extends Component {
2828
const currentDeg = valueToDeg({
2929
min: props.min,
3030
max: props.max,
31-
value: props.value || props.min
31+
value: props.value != null ? props.value : props.min
3232
});
3333

3434
this.state = {

0 commit comments

Comments
 (0)