Closed BHznJNs closed 2 months ago
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
Describe the bug I tried to run the
examples/dash_demo.py
, when I opened theCode Export
dialog and tried to copy the code with theCopy to Clipboard
button, it does not work. When I opened the browser console, it showed a JavaScript error.To Reproduce
export_code
buttonCopy to Clipboard
button in theCode Export
dialogExpected behavior Able to copy the code by clicking the
Copy to Clipboard
buttonScreenshots
Clicking the![Clicking the `Copy to Clipboard` button](https://github.com/Kanaries/pygwalker/assets/67158072/62cbf91d-06d9-4b9b-a1a3-2758c1666536)
Copy to Clipboard
buttonShows an JavaScript TypeError in the browser console![Shows an JavaScript TypeError in the browser console](https://github.com/Kanaries/pygwalker/assets/67158072/055a7119-f1f8-4bb4-aaeb-14d41928ac1c)
Versions
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 nameclipboard-read
as PermissionName. In this w3c PR, the clipboard-read permission was removed. In this page, it seems that theclipboard-read
field is not in the PermissionName enum for Firefox, while in this page, it seems that theclipboard-read
is a non-standard field in the PermissionName enum for Chromium.