Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/element-pan.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ var ElementPan = React.createClass({
eventListener.add(window, 'mouseup', this.onDragStop);
eventListener.add(window, 'touchend', this.onDragStop);

// If we have multiple child nodes, use the scroll[Height/Width]
// If we have any child nodes, use the scroll[Height/Width]
// If we have no child-nodes, use bounds to find size of inner content
var bounds, target = e.currentTarget || e.target;
if (target.childNodes.length > 1) {
if (target.childNodes.length > 0) {
bounds = { width: target.scrollWidth, height: target.scrollHeight };
} else {
bounds = e.target.getBoundingClientRect();
Expand Down