()
| 173 | validation.commitValidation(); |
| 174 | }; |
| 175 | let decrement = () => { |
| 176 | let newValue = addColorValue(parsedValue, -step); |
| 177 | // if we've arrived at the same value that was previously in the state, the |
| 178 | // input value should be updated to match |
| 179 | // ex type 4, press increment, highlight the number in the input, type 4 again, press increment |
| 180 | // you'd be at 5, then incrementing to 5 again, so no re-render would happen and 4 would be left in the input |
| 181 | if (newValue === colorValue) { |
| 182 | setInputValue(newValue.toString('hex')); |
| 183 | } |
| 184 | safelySetColorValue(newValue); |
| 185 | validation.commitValidation(); |
| 186 | }; |
| 187 | let incrementToMax = () => safelySetColorValue(MAX_COLOR); |
| 188 | let decrementToMin = () => safelySetColorValue(MIN_COLOR); |
| 189 |
no test coverage detected