mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-09-11 18:37:33 -04:00
Merge pull request #3665 from alphagov/fix-bug-with-copy-to-clipboard
Fix bug with copy to clipboard
This commit is contained in:
@@ -29,9 +29,10 @@
|
|||||||
|
|
||||||
this.getRangeFromElement = function (keyElement) {
|
this.getRangeFromElement = function (keyElement) {
|
||||||
const range = document.createRange();
|
const range = document.createRange();
|
||||||
|
const childNodes = Array.prototype.slice.call(keyElement.childNodes);
|
||||||
let prefixIndex = -1;
|
let prefixIndex = -1;
|
||||||
|
|
||||||
Array.from(keyElement.childNodes).forEach((el, idx) => {
|
childNodes.forEach((el, idx) => {
|
||||||
if ((el.nodeType === 1) && el.classList.contains('govuk-visually-hidden')) {
|
if ((el.nodeType === 1) && el.classList.contains('govuk-visually-hidden')) {
|
||||||
prefixIndex = idx;
|
prefixIndex = idx;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,6 +22,7 @@
|
|||||||
|
|
||||||
position: absolute;
|
position: absolute;
|
||||||
bottom: 2px;
|
bottom: 2px;
|
||||||
|
left: 0px;
|
||||||
|
|
||||||
&:active {
|
&:active {
|
||||||
top: auto;
|
top: auto;
|
||||||
|
|||||||
Reference in New Issue
Block a user