diff --git a/src/index.jsx b/src/index.jsx index 54d1019..9f5dcc5 100644 --- a/src/index.jsx +++ b/src/index.jsx @@ -44,7 +44,7 @@ class CircularProgressbar extends React.Component { const diameter = Math.PI * 2 * radius; const progressStyle = { strokeDasharray: `${diameter}px ${diameter}px`, - strokeDashoffset: `${((100 - this.state.percentage) / 100 * diameter)}px`, + strokeDashoffset: `${((100 - Math.min(Math.max(this.state.percentage, 0), 100)) / 100 * diameter)}px`, }; const classForPercentage = this.props.classForPercentage ? this.props.classForPercentage(this.props.percentage) : '';