diff --git a/app/assets/javascripts/apiKey.js b/app/assets/javascripts/apiKey.js index cdd7aaf0e..4d8658a7c 100644 --- a/app/assets/javascripts/apiKey.js +++ b/app/assets/javascripts/apiKey.js @@ -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; } diff --git a/app/assets/stylesheets/components/api-key.scss b/app/assets/stylesheets/components/api-key.scss index b481c9558..8ea44a3f1 100644 --- a/app/assets/stylesheets/components/api-key.scss +++ b/app/assets/stylesheets/components/api-key.scss @@ -22,6 +22,7 @@ position: absolute; bottom: 2px; + left: 0px; &:active { top: auto;