diff --git a/src/cellmanager.js b/src/cellmanager.js index b736fc2..5c7d286 100644 --- a/src/cellmanager.js +++ b/src/cellmanager.js @@ -561,21 +561,18 @@ export default class CellManager { // copy only focusedCell const { colIndex, - rowIndex + rowIndex, + isTotalRow } = $.data($cell1); - if (rowIndex === undefined) { - // this must be a footer - const {isTotalRow} = $.data($cell1); - if (isTotalRow) { - let choosenFooterCell = $('.dt-row-totalRow > .dt-cell--focus'); - let content = choosenFooterCell.children[0].title; - copyTextToClipboard(content); - return 1; - } + let copiedContent = "" + if (isTotalRow) { + let choosenFooterCell = this.$focusedCell; + copiedContent = choosenFooterCell.children[0].title; + }else{ + const cell = this.getCell(colIndex, rowIndex); + copiedContent = cell.content } - const cell = this.getCell(colIndex, rowIndex); - - copyTextToClipboard(cell.content); + copyTextToClipboard(copiedContent); return 1; } const cells = this.getCellsInRange($cell1, $cell2);