Skip to content

Commit c81ef85

Browse files
authored
Merge branch 'master' into feature/unit-in-onZoom-and-onTimeChange-callbacks
2 parents 39817fa + f7ffd40 commit c81ef85

File tree

4 files changed

+14
-4
lines changed

4 files changed

+14
-4
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@ and this project adheres (more or less) to [Semantic Versioning](http://semver.o
99

1010
* Add unit argument to onZoom and onTimeChange callbacks
1111

12+
## 0.26.7
13+
14+
* fix scrolling with trackpad @ilaiwi #679
15+
* remove duplicate proptype validation in `TimelineStateContext` @xat
16+
1217
## 0.26.6
1318

1419
* fix `visibleTimeStart`, `visibleTimeEnd` and `onTimeChange` not working as expected in controlled mode @ilaiwi

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-calendar-timeline",
3-
"version": "0.26.6",
3+
"version": "0.26.7",
44
"description": "react calendar timeline",
55
"main": "lib/index.js",
66
"scripts": {

src/lib/scroll/ScrollElement.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,13 @@ class ScrollElement extends Component {
2222
}
2323
}
2424

25-
25+
/**
26+
* needed to handle scrolling with trackpad
27+
*/
28+
handleScroll = () => {
29+
const scrollX = this.scrollComponent.scrollLeft
30+
this.props.onScroll(scrollX)
31+
}
2632

2733
refHandler = el => {
2834
this.scrollComponent = el
@@ -192,6 +198,7 @@ class ScrollElement extends Component {
192198
onTouchStart={this.handleTouchStart}
193199
onTouchMove={this.handleTouchMove}
194200
onTouchEnd={this.handleTouchEnd}
201+
onScroll={this.handleScroll}
195202
>
196203
{children}
197204
</div>

src/lib/timeline/TimelineStateContext.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,6 @@ export class TimelineStateProvider extends React.Component {
4343
canvasWidth: PropTypes.number.isRequired,
4444
showPeriod: PropTypes.func.isRequired,
4545
timelineUnit: PropTypes.string.isRequired,
46-
showPeriod: PropTypes.func.isRequired,
47-
timelineUnit: PropTypes.string.isRequired,
4846
timelineWidth: PropTypes.number.isRequired,
4947
}
5048

0 commit comments

Comments
 (0)