Skip to content

Commit

Permalink
The fix was actually this simple
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremyestein committed Dec 31, 2023
1 parent c654da9 commit 5665126
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,7 @@ function makeCopyButtons() {
var item = dataItemFromBI(bi);
var butt = document.createElement('BUTTON');
butt.className = copy_button_class;
// BUG!
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Closures#creating_closures_in_loops_a_common_mistake
var copyString = formatItemAsStr(item);
let copyString = formatItemAsStr(item);
butt.onclick = () => { navigator.clipboard.writeText(copyString); };
butt.innerHTML = 'Copy';
bi.prepend(butt);
Expand Down

0 comments on commit 5665126

Please sign in to comment.