()
| 161 | }; |
| 162 | |
| 163 | let increment = () => { |
| 164 | let newValue = addColorValue(parsedValue, step); |
| 165 | // if we've arrived at the same value that was previously in the state, the |
| 166 | // input value should be updated to match |
| 167 | // ex type 4, press increment, highlight the number in the input, type 4 again, press increment |
| 168 | // you'd be at 5, then incrementing to 5 again, so no re-render would happen and 4 would be left in the input |
| 169 | if (newValue === colorValue) { |
| 170 | setInputValue(newValue.toString('hex')); |
| 171 | } |
| 172 | safelySetColorValue(newValue); |
| 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 |
no test coverage detected