update getLowerBound and getUpperBound to check startPoint prop
more understandable code
Co-authored-by: michael kantz <michael@3dcastor.com>
183 | 183 | } |
|
184 | 184 | ||
185 | 185 | getLowerBound() { |
|
186 | - | return this.props.min; |
|
186 | + | const minPoint = this.props.startPoint || this.props.min; |
|
187 | + | return this.state.value > minPoint ? minPoint : this.state.value; |
|
187 | 188 | } |
|
188 | 189 | ||
189 | 190 | getUpperBound() { |
|
191 | + | if (this.state.value < this.props.startPoint) { |
|
192 | + | return this.props.startPoint; |
|
193 | + | } |
|
190 | 194 | return this.state.value; |
|
191 | 195 | } |
|
192 | 196 |
Files | Coverage |
---|---|
src | 88.58% |
Project Totals (11 files) | 88.58% |