Skip to content

Commit

Permalink
fix(context): when copying use opacity 0 on temp element
Browse files Browse the repository at this point in the history
- we can just use `opacity: 0` instead of `left: -1000px` because on computer with high resolution DPI, it might end up showing the temp element we use to copy and we wouldn't want to show it to the user
  • Loading branch information
ghiscoding committed Nov 2, 2021
1 parent 2721bcb commit 3f0896f
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions packages/common/src/extensions/contextMenuExtension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -433,8 +433,7 @@ export class ContextMenuExtension implements Extension {
const tmpElem = document.createElement('textarea') as HTMLTextAreaElement;
if (tmpElem && document.body) {
tmpElem.style.position = 'absolute';
tmpElem.style.left = '-1000px';
tmpElem.style.top = '-1000px';
tmpElem.style.opacity = '0';
tmpElem.value = finalTextToCopy;
document.body.appendChild(tmpElem);
tmpElem.select();
Expand Down

0 comments on commit 3f0896f

Please sign in to comment.