Copy file path, not working as expected in Safari, clipboard contents unexpected
Summary
If you try to copy the file path of a file which is referred in a Merge Request, the contents of the clipboard is not directly useful without manually editing it.
Steps to reproduce
- Open Safari 13.1.2
- Log into Gitlab
- Find a Merge Request (e.g. !39811 (diffs))
- Navigate to file
Dependency-Scanning.gitlab-ci.yml
- Click on the button
Copy file path
on the right side of the filename - Notice the clipboard content is
{"text":"lib/gitlab/ci/templates/Security/Dependency-Scanning.gitlab-ci.yml","gfm":"`lib/gitlab/ci/templates/Security/Dependency-Scanning.gitlab-ci.yml`"}
instead of the actual file path "src/commandHandlers/fetch/fetch.ts
The behaviour in Chrome appears to be as expected.
Example Project
You can use the public accessible version of Gitlab, e.g. use this merge request: !39811 (diffs)
What is the current bug behavior?
After clicking the button the clipboard contents has a JSON blob is returned instead of the filename
What is the expected correct behavior?
The clipboard contents should the actual file path instead of a JSON blob
Relevant logs and/or screenshots
No console logs available
Output of checks
This bug happens on GitLab.com
Results of GitLab environment info
This bug happens on GitLab.com
Results of GitLab application Check
This bug happens on GitLab.com
Possible fixes
I assume the code needs to be adapted to only copy the actual contents to the clipboard instead of a JSON blob. Only I don't know where to look in the code base.