Skip to content

Commit

Permalink
Fix color ranges validation (elastic#54253) (elastic#54715)
Browse files Browse the repository at this point in the history
  • Loading branch information
sulemanof authored Jan 15, 2020
1 parent b70df56 commit 4299555
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ function ColorRanges({

const validateRange = useCallback(
({ from, to }, index) => {
if (!colorsRange[index]) {
return [false, false];
}

const leftBound = index === 0 ? -Infinity : colorsRange[index - 1].to || 0;
const isFromValid = from >= leftBound;
const isToValid = to >= from;
Expand Down

0 comments on commit 4299555

Please sign in to comment.