From 5b360c5d43dd303ad345938bd87b37bddd865424 Mon Sep 17 00:00:00 2001 From: Wojciech Maj Date: Thu, 26 Aug 2021 14:24:56 +0200 Subject: [PATCH] Only add hover classes when first value was selected Closes #505 --- src/shared/utils.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/shared/utils.js b/src/shared/utils.js index 38041b13..4e1d495e 100644 --- a/src/shared/utils.js +++ b/src/shared/utils.js @@ -106,8 +106,10 @@ export function getTileClasses({ classes.push(...valueRangeClassNames); - if (hover) { - const hoverRange = hover > valueRange[1] ? [valueRange[1], hover] : [hover, valueRange[0]]; + const valueArray = [].concat(value); + + if (hover && valueArray.length === 1) { + const hoverRange = hover > valueRange[0] ? [valueRange[0], hover] : [hover, valueRange[0]]; const hoverRangeClassNames = getRangeClassNames(hoverRange, dateRange, `${className}--hover`); classes.push(...hoverRangeClassNames);