blur() results in a loss/reset of keyboard focus, meaning keyboard users usually get thrown right back to the start of the page. Instead, this moves focus back to the trigger (which had the focus when the trigger was activated).
As with the proposed fix in https://github.com/zenorocha/clipboard.js/pull/418 this obviously results in the focus styles (like the default outline, unless suppressed) being applied to the trigger (see the related PR for rationale and future fix using `:focus-ring`)
* Allow container option to fix bugs related to bootstrap modals etc.
* Updated readme to reflect addition of container option
* Name link
* Removed test log
* Remove unwanted whitespace
* Refactored description
* little fix
* little fix /2
* test/clipboard.js refactored
* emitter: emitter --> emitter
* Examples in ES6
* es6
* back to original code
* script > npm test
* script > npm test not necessary
* updating modules
* removing export default
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'
My previous fix didn't actually work. Instead of scrolling to the bottom it would scroll to the top, because it turns out document.body.scrollTop always returns 0 in Firefox.
This should work in most browsers.
See here: http://help.dottoro.com/ljnvjiow.php
In Firefox < 41, the selecting fakeElem.select() would cause the browser to scroll to the bottom of the page.
By positioning fakeElem at the current scroll position, but still way out to the left, that no longer happens.
This PR renames all the data-attributes for data-clipboard-X, this is due the possibility of conflict with projects that already uses these data-attributes.