S2 icon indicating copy to clipboard operation
S2 copied to clipboard

Copying cells not working in firefox and cannot copy row headers🐛

Open ThamaluM opened this issue 2 years ago • 1 comments

🏷 Version 1.26.0

Package Version
@antv/s2 1.26.0

Sheet Type

  • [ ] PivotSheet

🖋 Description

  1. I cannot copy cell values in the Firefox browser. (Selecting the cells with mouse and Cntrl+C)
  2. I cannot copy row/column headers in the Chrome browser (I can copy cell values).
  3. The columns are copied without newline characters.
  4. When I right-click after selecting cells, there is no copy option in the pop-up menu.

Note: Above 1: Uncaught ReferenceError: ClipboardItem is not defined It looks like Firefox and several other browsers do not support ClipboardItem object by default (https://developer.mozilla.org/en-US/docs/Web/API/ClipboardItem/ClipboardItem).

It may be helpful to you to mention that I used navigator.clipboard.writeText(S2.copyData(datasheet,'\t',true)) instead of S2.copyToClipboard(data) to implement the copy button.

⌨️ Code Snapshots

   const segment_s2Options = {
        width: screen.width*10/12,
        height: screen.height*0.3,
        style: {
            layoutWidthType: 'colAdaptive'
        },
        interaction: {
            enableCopy: true,
            selectedCellsSpotlight: false,
            hoverHighlight: false,
            selectedCellHighlight: true
        }
}

ThamaluM avatar Aug 15 '22 13:08 ThamaluM

你好 @ThamaluM,很抱歉给你带来了不好的体验, 我们会尽快排查问题并修复, 请关注后续发布日志.

Hello, @ThamaluM, We are so sorry for the bad experience. We will troubleshoot and fix the problem as soon as possible. Please pay attention to the follow-up change logs.

github-actions[bot] avatar Aug 17 '22 02:08 github-actions[bot]

The latest version has been fixed, use sync copy when ClipboardItem is not supported

lijinke666 avatar Dec 23 '22 03:12 lijinke666