Skip to content

Commit 3115181

Browse files
committed
clear preview on mouse leave on defined range item
1 parent 28816b0 commit 3115181

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

src/components/DefinedRange.js

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,7 @@ class DefinedRanges extends Component {
3333
render() {
3434
const { onPreviewChange, ranges, rangeColors, className } = this.props;
3535
return (
36-
<div
37-
className={cx(styles.definedRangesWrapper, className)}
38-
onMouseLeave={() => {
39-
this.props.onPreviewChange && this.props.onPreviewChange();
40-
}}>
36+
<div className={cx(styles.definedRangesWrapper, className)}>
4137
{this.props.headerContent}
4238
<div className={styles.staticRanges}>
4339
{this.props.staticRanges.map((staticRange, i) => {
@@ -57,7 +53,10 @@ class DefinedRanges extends Component {
5753
onFocus={() => onPreviewChange && onPreviewChange(staticRange.range(this.props))}
5854
onMouseOver={() =>
5955
onPreviewChange && onPreviewChange(staticRange.range(this.props))
60-
}>
56+
}
57+
onMouseLeave={() => {
58+
this.props.onPreviewChange && this.props.onPreviewChange();
59+
}}>
6160
<span tabIndex={-1} className={styles.staticRangeLabel}>
6261
{staticRange.label}
6362
</span>

0 commit comments

Comments
 (0)