The return value of handleCopy prop does not get copied to the clipboard.
The docs mention that
function ({ event, dataRenderer, valueRenderer, data, start, end, range }) If set, this function is called whenever the user copies cells. The return string of this function is stored on the clipboard.
but the return value does not get copied automatically.
I looked through the code and found that the copy method is never being called for the return value of the handleCopy prop.
if (this.props.handleCopy) {
this.props.handleCopy({
event: e,
dataRenderer: dataRenderer,
valueRenderer: valueRenderer,
data: data,
start: start,
end: end,
range: range,
}); <== The return value is not being copied anywhere.
} else {
var text = range(start.i, end.i)
.map(function (i) {
return range(start.j, end.j)
.map(function (j) {
var cell = data[i][j];
var value = dataRenderer ? dataRenderer(cell, i, j) : null;
if (
value === '' ||
value === null ||
typeof value === 'undefined'
) {
return valueRenderer(cell, i, j);
}
return value;
})
.join('\t');
})
.join('\n');
if (window.clipboardData && window.clipboardData.setData) {
window.clipboardData.setData('Text', text);
} else {
e.clipboardData.setData('text/plain', text);
}
}
Hi,
The return value of handleCopy prop does not get copied to the clipboard.
The docs mention that
but the return value does not get copied automatically.
I looked through the code and found that the copy method is never being called for the return value of the handleCopy prop.