From 43d9c11aafb5ad60ce45c7a77d7184d43e09a00c Mon Sep 17 00:00:00 2001 From: Stepan Mikhaylyuk Date: Thu, 25 Feb 2016 15:20:13 +0300 Subject: [PATCH] minor fix for fake elem after call clipboard all page scrolls down. As i understand, its relates to fake element, cause its append to body. I just set position to 'fixed' and now it works right. I think 'fixed' is more css-style independence then 'absolute' --- src/clipboard-action.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/clipboard-action.js b/src/clipboard-action.js index 38875b4..ea2626d 100644 --- a/src/clipboard-action.js +++ b/src/clipboard-action.js @@ -65,7 +65,7 @@ export default class ClipboardAction { this.fakeElem.style.padding = '0'; this.fakeElem.style.margin = '0'; // Move element out of screen horizontally - this.fakeElem.style.position = 'absolute'; + this.fakeElem.style.position = 'fixed'; this.fakeElem.style[ isRTL ? 'right' : 'left' ] = '-9999px'; // Move element to the same position vertically this.fakeElem.style.top = (window.pageYOffset || document.documentElement.scrollTop) + 'px';