diff --git a/index.js b/index.js index bbacd34..be7e7e7 100644 --- a/index.js +++ b/index.js @@ -25,10 +25,11 @@ exports.install = function (Vue, options) { var styles = window.getComputedStyle(_this.el, null); Object.assign(_this.mirror.style, { position: "absolute", - top: "0", - left: "0", + top: "-9999px", + left: "-9999px", width: "auto", whiteSpace: "nowrap", + opacity: 0, border: styles.getPropertyValue("border"), fontSize: styles.getPropertyValue("font-size"), fontFamily: styles.getPropertyValue("font-family"), @@ -36,8 +37,7 @@ exports.install = function (Vue, options) { letterSpacing: styles.getPropertyValue("letter-spacing"), padding: styles.getPropertyValue("padding"), textTransform: styles.getPropertyValue("text-transform"), - ariaHidden: true, - opacity: 0 + ariaHidden: true }); document.body.appendChild(_this.mirror); _this.check(_this.el); diff --git a/index.umd.js b/index.umd.js index b31e733..0809447 100644 --- a/index.umd.js +++ b/index.umd.js @@ -33,13 +33,15 @@ left: "-9999px", width: "auto", whiteSpace: "nowrap", + opacity: 0, + border: styles.getPropertyValue("border"), fontSize: styles.getPropertyValue("font-size"), fontFamily: styles.getPropertyValue("font-family"), fontWeight: styles.getPropertyValue("font-weight"), letterSpacing: styles.getPropertyValue("letter-spacing"), + padding: styles.getPropertyValue("padding"), textTransform: styles.getPropertyValue("text-transform"), - ariaHidden: true, - opacity: 0 + ariaHidden: true }); document.body.appendChild(_this.mirror); _this.check(_this.el); diff --git a/src/index.js b/src/index.js index 7b1a77d..12a7dfa 100644 --- a/src/index.js +++ b/src/index.js @@ -24,10 +24,11 @@ exports.install = function(Vue, options){ let styles = window.getComputedStyle(this.el, null); Object.assign(this.mirror.style, { position: "absolute", - top: "0", - left: "0", + top: "-9999px", + left: "-9999px", width: "auto", whiteSpace: "nowrap", + opacity: 0, border: styles.getPropertyValue("border"), fontSize: styles.getPropertyValue("font-size"), fontFamily: styles.getPropertyValue("font-family"), @@ -35,8 +36,7 @@ exports.install = function(Vue, options){ letterSpacing: styles.getPropertyValue("letter-spacing"), padding: styles.getPropertyValue("padding"), textTransform: styles.getPropertyValue("text-transform"), - ariaHidden: true, - opacity: 0 + ariaHidden: true }); document.body.appendChild(this.mirror); this.check(this.el);