Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Clicking Copy to Clipboard button causes a JavaScript error #542

Closed
BHznJNs opened this issue May 8, 2024 · 1 comment
Closed
Labels
bug Something isn't working P2 will be fixed in two weeks

Comments

@BHznJNs
Copy link
Contributor

BHznJNs commented May 8, 2024

Describe the bug
I tried to run the examples/dash_demo.py, when I opened the Code Export dialog and tried to copy the code with the Copy to Clipboard button, it does not work. When I opened the browser console, it showed a JavaScript error.

To Reproduce

  1. Open Dataset with Pygwalker
  2. Click on the export_code button
  3. Click the Copy to Clipboard button in the Code Export dialog
  4. The copying operation does not work and shows an error in the browser console

Expected behavior
Able to copy the code by clicking the Copy to Clipboard button

Screenshots

Clicking the Copy to Clipboard button
Clicking the Copy to Clipboard button

Shows an JavaScript TypeError in the browser console
Shows an JavaScript TypeError in the browser console

Versions

  • pygwalker version: 0.4.8.3
  • python version: 3.10.7
  • browser: Firefox 125.0.3 on Windows11 x86_64

Additional context
With the MDN Permissions API docs, I assumes the bug is occured by the implement difference between browsers.
In the line 45 of source code file app\src\components\codeExportModal\index.tsx, it used name clipboard-read as PermissionName. In this w3c PR, the clipboard-read permission was removed.
In this page, it seems that the clipboard-read field is not in the PermissionName enum for Firefox, while in this page, it seems that the clipboard-read is a non-standard field in the PermissionName enum for Chromium.

@BHznJNs BHznJNs added the bug Something isn't working label May 8, 2024
@longxiaofei longxiaofei added the P2 will be fixed in two weeks label May 8, 2024
@longxiaofei
Copy link
Member

Hi, @BHznJNs

Thanks for your feedback.

It seems that there are some bugs when check permissions of clipboard.

If you're willing, you might try to fix it.

Looking forward to your PR.

function name: copyToCliboard
code location: app\src\components\codeExportModal\index.tsx  - line:44

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working P2 will be fixed in two weeks
Projects
None yet
Development

No branches or pull requests

2 participants