Skip to content

Commit 201e889

Browse files
authored
Merge pull request #141 from fyfirman/master
fix(csv-to-json): copy to clipboard is not working
2 parents 4144c21 + ac8eb7a commit 201e889

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

js/app.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

js/src/main.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,11 @@ $(document).ready(function() {
157157
$copy.on('click', function(e) {
158158
e.preventDefault();
159159
$textarea[0].select();
160-
document.execCommand('copy');
160+
if (navigator.clipboard) {
161+
navigator.clipboard.writeText($textarea[0].value);
162+
} else {
163+
document.execCommand('copy');
164+
}
161165
});
162166
},
163167

js/src/version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.315
1+
0.316

0 commit comments

Comments
 (0)