You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2022/01/25 16:38:28 UTC

[GitHub] [superset] nytai opened a new issue #18154: Copy to clipboard fails in safari

nytai opened a new issue #18154:
URL: https://github.com/apache/superset/issues/18154


   For some actions the copy to clipboard action fails in safari. It appears that safari has strict security measures in place for the copy api. The copy api cannot be called from an api response and must be called from a user interaction (a DOM callback event). This is causing actions in superset that follow the pattern of call some api (usually to save some value) then copy the api response to clipboard to fail. The error message that's thrown suggest using `cmd/ctrl + c` to copy the value, however the value is not stored anywhere the user can highlight and copy. 
   
   #### How to reproduce the bug
   
   1. Open Safari browser
   2. Go to SQL Lab > SQL Editor
   3. Click "Copy Link" button
   4. See error
   
   ### Expected results
   
   Results are copied to clipboard or an acceptable workaround is presented to the user, such as displaying the value that should have been copied so the user can highly and `cmd/ctrl + c` the value.  
   
   ### Actual results
   
   Copy to clipboard fails, an toast is thrown "Sorry, your browser does not support copying. Use Ctrl / Cmd + C!", and the user is unable to copy the value to clipboard 
   
   #### Screenshots
   
   <img width="2542" alt="Screen Shot 2022-01-24 at 11 54 04 AM" src="https://user-images.githubusercontent.com/10255196/150854768-9425fbc2-1612-410c-bb68-fda03bf44f1a.png">
   
   
   ### Environment
   
   (please complete the following information):
   
   - browser type and version: Safari (latest)
   - superset version: `1.4.0`
   - python version: 3.8.12
   - node.js version: N/A (using prebuilt assets)
   - any feature flags active: N/A
   
   ### Checklist
   
   Make sure to follow these steps before submitting your issue - thank you!
   
   - [x] I have checked the superset logs for python stacktraces and included it here as text if there are any.
   - [x] I have reproduced the issue with at least the latest released version of superset.
   - [x] I have checked the issue tracker for the same issue and I haven't found one similar.
   
   ### Additional context
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] nytai commented on issue #18154: Copy to clipboard fails in safari

Posted by GitBox <gi...@apache.org>.
nytai commented on issue #18154:
URL: https://github.com/apache/superset/issues/18154#issuecomment-1020492882


   It seems a way around this is store the returned value in the DOM somehow and add a copy to clipboard button which should work. If that doesn't work, at the very least the value is stored somewhere the user can highlight and `cmd/ctrl + c` manually. 
   
   A fix could be, when the copy to clipboard action fails:
   - open a modal with the text value
   - add a copy to clipboard button there (this should work)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] nytai edited a comment on issue #18154: Copy to clipboard fails in safari

Posted by GitBox <gi...@apache.org>.
nytai edited a comment on issue #18154:
URL: https://github.com/apache/superset/issues/18154#issuecomment-1020492882


   It seems a way around this is store the returned value in the DOM somehow and add a copy to clipboard button which should work. If that doesn't work, at the very least the value is stored somewhere the user can highlight and `cmd/ctrl + c` manually. This fallback could be called when the `copyTextToClipboard` action fails (the promise rejects) 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] nytai commented on issue #18154: Copy to clipboard fails in safari

Posted by GitBox <gi...@apache.org>.
nytai commented on issue #18154:
URL: https://github.com/apache/superset/issues/18154#issuecomment-1020497545


   I suppose an even easier fix (though a little annoying) would be to add the copy text to the failure toast, then the user could just copy the value manually from there. 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] nytai commented on issue #18154: Copy to clipboard fails in safari

Posted by GitBox <gi...@apache.org>.
nytai commented on issue #18154:
URL: https://github.com/apache/superset/issues/18154#issuecomment-1020492882






-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] nytai edited a comment on issue #18154: Copy to clipboard fails in safari

Posted by GitBox <gi...@apache.org>.
nytai edited a comment on issue #18154:
URL: https://github.com/apache/superset/issues/18154#issuecomment-1020492882


   It seems a way around this is store the returned value in the DOM somehow and add a copy to clipboard button which should work. If that doesn't work, at the very least the value is stored somewhere the user can highlight and `cmd/ctrl + c` manually. This fallback could be called when the `copyTextToClipboard` action fails (the promise rejects) 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org