-
Notifications
You must be signed in to change notification settings - Fork 915
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] Share > Copy link broken in Safari #1716
[BUG] Share > Copy link broken in Safari #1716
Comments
Great find! From a quick look at the source code, I suspect this bug may actually be in the EUI component ( OpenSearch-Dashboards/src/plugins/share/public/components/url_panel_content.tsx Lines 128 to 152 in b2cfb6e
|
Hello @wkruse! Thanks for opening! @joshuarrrr is correct. EuiCopy eventually calls So Safari must have removed support for this and eventually other browsers might as well. Unfortunately this is in the design system library. So should be fixed when the official fork is produced. Tagging @opensearch-project/opensearch-ux for visibility. |
+1 to make this as a design system priority. There's no visual/UX changes, but we want to make sure we're doing the right thing from a functionality perspective. @joshuarrrr + @kavilla - in addition to the deprecation of using document.execCommand, there's a new |
Yep, for browser compatibility we'd need to support both: https://stackoverflow.com/a/60239236 |
To me, this sounds like |
Thanks for the update @AMoo-Miki. We should prioritize fixing this in OUI. What are the next steps? |
Closing this issue in favor of a fix by OUI - issue here: opensearch-project/oui#314 |
This is not an issue of OUI.
The problem is that Firefox, Chrome, and Safari, each react differently. If some text in a node is "selected":
As a result, when the button to copy link is hit:
This issue should be raised on security plugin. The appropriate solution would be for securityDashboards to change their listener to:
When the listener is done, the copy would occur. |
@opensearch-project/triage Can you please transfer to https://github.com/opensearch-project/security-dashboards-plugin |
Can an admin transfer this to the security-dashboards-plugin repo? |
I will pick this up @davidlago, please assign me. |
This ticket has been picked back up. |
Note: In recent opensearch versions this issue is fixed. |
@leanneeliatra + @AMoo-Miki -- Do we know which PR addressed this issue? i'd love to link it here. |
After further investigation I was mistaken! I'm still working on a fix. |
The solution for this issue is in progress. |
I'm attempting to solve this issue and have read the comments and ticket.
This approach may be a no go, logging for recording purposes. |
Have you by chance tried my suggestion above? I believe with that specific sequence, the problem would be worked around in all the browsers:
|
Hi @AMoo-Miki I am in the process of looking into your solution at the moment. Can I check please, do you mean for me to update the selection range of the text, something like this: https://javascript.info/selection-range? |
Yes Leanne. The change I was proposing would go into security-dashboards-plugin where they manipulate the URL of the shareable. |
Thank you very much for the recommendation, I have the fix added here: https://github.com/leanneeliatra/security-dashboards-plugin-fork/tree/safari-copy-link-fix |
Update:
|
Can I confirm both cypress tests and unit tests are required here please? |
Hi, can someone assist in making sure I am creating the tests in the right repository and that both cypress, and unit tests are required for this ticket please? (I presume yes, but for my last ticket unit tests were not required, so best to check). |
Thanks for the question - it depends 😆 Generally speaking every change should have a test associated with it. Sometimes a unit test is more than enough. Another way you could approach this issue is by building a test case that fails and then making a fix that has the test passing. |
I'd recommend creating a pull request and then you can get guidance based on the changes you're making. |
Thanks Peter, yes good approach to create a test that fails, then fix until it is passing. The tests are going well locally but if I try to push to my fork, I get many linting errors so I was just continuing with the test as it's still not fully complete yet. This is what I get when attempting to push to my fork. So yes the update is still the same:
|
Update:
|
Update
|
PRs currently in review for merge. |
Not able to replicate this issue on my local or in playground |
Okay, some things that got me when I first tried to reproduce this, it must be done in Safari, safari is the only browser with this issue. Also, don't click the shortURL slider button. Just immediately click 'copy link'. Last thing, when I first did this I'm just so used to chrome, I went there first. Then when I realised and switched to Safari, the link was in the clipboard from Chrome, not safari, so when I copy and pasted I thought it worked! Copy something irrelevant (a word on the page, not a URL) then click copy link in Safari and the link should not copy. Just some small things that I was made aware of when first trying to reproduce in case they may be catching you, perhaps not. Update: it seems @derek-ho was not able to reproduce this either. |
Describe the bug
Share > Copy link is broken in Safari. When you try to copy a link, you hear a sound and see a popup which says Copied, but nothing is copied into the clipboard.
To Reproduce
Steps to reproduce the behavior:
Discover
Share
>Copy link
Expected behavior
Copy link
should work in Safari.OpenSearch Version
1.3.2
2.0.0
Dashboards Version
1.3.2
2.0.0
Plugins
Default from the corresponding official Docker images
Host/Environment (please complete the following information):
Additional context
In Google Chrome
102.0.5005.61
it works without issues.In Firefox
101.0
it works without issues.No logs in the Safari Developer Tools > Console, besides the two probably unrelated, which appear on page reload
Related to #689.
The text was updated successfully, but these errors were encountered: