Merge pull request #3665 from alphagov/fix-bug-with-copy-to-clipboard

Fix bug with copy to clipboard
This commit is contained in:
Tom Byers
2020-10-02 17:33:42 +01:00
committed by GitHub
2 changed files with 3 additions and 1 deletions

View File

@@ -29,9 +29,10 @@
this.getRangeFromElement = function (keyElement) {
const range = document.createRange();
const childNodes = Array.prototype.slice.call(keyElement.childNodes);
let prefixIndex = -1;
Array.from(keyElement.childNodes).forEach((el, idx) => {
childNodes.forEach((el, idx) => {
if ((el.nodeType === 1) && el.classList.contains('govuk-visually-hidden')) {
prefixIndex = idx;
}

View File

@@ -22,6 +22,7 @@
position: absolute;
bottom: 2px;
left: 0px;
&:active {
top: auto;