(start, end)
| 309 | } |
| 310 | |
| 311 | clearSelectedCells (start, end) { |
| 312 | const {data, onCellsChanged, onChange} = this.props |
| 313 | const cells = this.getSelectedCells(data, start, end) |
| 314 | .filter(cell => !cell.cell.readOnly) |
| 315 | .map(cell => ({...cell, value: ''})) |
| 316 | if (onCellsChanged) { |
| 317 | onCellsChanged(cells) |
| 318 | this.onRevert() |
| 319 | } else if (onChange) { |
| 320 | // ugly solution brought to you by https://reactjs.org/docs/react-component.html#setstate |
| 321 | // setState in a loop is unreliable |
| 322 | setTimeout(() => { |
| 323 | cells.forEach(({cell, row, col, value}) => { |
| 324 | onChange(cell, row, col, value) |
| 325 | }) |
| 326 | this.onRevert() |
| 327 | }, 0) |
| 328 | } |
| 329 | } |
| 330 | |
| 331 | handleNavigate (e, offsets, jumpRow) { |
| 332 | if (offsets && (offsets.i || offsets.j)) { |
nothing calls this directly
no test coverage detected