react-calendar-timeline
Advanced tools
Comparing version 0.16.1 to 0.16.2
@@ -10,2 +10,7 @@ # Change Log | ||
### 0.16.2 | ||
### Fixed | ||
* clicking on canvas when item is selected now calls `onCanvasClicked` - #312 | ||
### 0.16.1 | ||
@@ -12,0 +17,0 @@ |
@@ -1145,6 +1145,10 @@ 'use strict'; | ||
// if not clicking on an item | ||
// shouldn't the canvas know its being clicked on directly? | ||
if (!(0, _domHelpers.hasSomeParentTheClass)(e.target, 'rct-item')) { | ||
if (_this4.state.selectedItem) { | ||
_this4.selectItem(null); | ||
} else if (_this4.props.onCanvasClick) { | ||
} | ||
// always call onCanvasClick, whether unselecting or not | ||
if (_this4.props.onCanvasClick) { | ||
var _rowAndTimeFromScroll = _this4.rowAndTimeFromScrollAreaEvent(e), | ||
@@ -1151,0 +1155,0 @@ _rowAndTimeFromScroll2 = _slicedToArray(_rowAndTimeFromScroll, 2), |
{ | ||
"name": "react-calendar-timeline", | ||
"version": "0.16.1", | ||
"version": "0.16.2", | ||
"description": "react calendar timeline", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -28,3 +28,3 @@ # React Calendar Timeline | ||
// make sure you include the timeline stylesheet or the timeline will not be styled | ||
import 'react-calender-timeline/lib/Timeline.css' | ||
import 'react-calendar-timeline/lib/Timeline.css' | ||
import moment from 'moment' | ||
@@ -31,0 +31,0 @@ |
@@ -702,6 +702,10 @@ import PropTypes from 'prop-types' | ||
// if not clicking on an item | ||
// shouldn't the canvas know its being clicked on directly? | ||
if (!hasSomeParentTheClass(e.target, 'rct-item')) { | ||
if (this.state.selectedItem) { | ||
this.selectItem(null) | ||
} else if (this.props.onCanvasClick) { | ||
} | ||
// always call onCanvasClick, whether unselecting or not | ||
if (this.props.onCanvasClick) { | ||
const [row, time] = this.rowAndTimeFromScrollAreaEvent(e) | ||
@@ -708,0 +712,0 @@ if (row >= 0 && row < this.props.groups.length) { |
294709
6503