diff --git a/vendor/assets/javascripts/handsontable.formula.js b/vendor/assets/javascripts/handsontable.formula.js index f41768007..338097040 100644 --- a/vendor/assets/javascripts/handsontable.formula.js +++ b/vendor/assets/javascripts/handsontable.formula.js @@ -199,12 +199,12 @@ var beforeAutofillInsidePopulate = function(index, direction, data, deltas, iterators, selected) { var instance = this; - var r = index.row, - c = index.col, + var rlength = data.length, // rows + clength = data[0].length, //cols + r = index.row % rlength, + c = index.col % clength, value = data[r][c], - delta = 0, - rlength = data.length, // rows - clength = data ? data[0].length : 0; //cols + delta = 0; if (value[0] === '=') { // formula