From 3629c2c0d53ec754bd6951629148092f2afe177a Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Thu, 22 Oct 2020 12:32:33 -0400 Subject: [PATCH] use element classList to add animations (#1436) --- src/content/autofill.js | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/content/autofill.js b/src/content/autofill.js index d39cb42c007..ca6c75ae088 100644 --- a/src/content/autofill.js +++ b/src/content/autofill.js @@ -820,12 +820,17 @@ setValueForElement(el); afterValSetFunc(el); setValueForElementByEvent(el); - canSeeElementToStyle(el) && (el.className += ' com-bitwarden-browser-animated-fill', + + // START MODIFICATION + if (canSeeElementToStyle(el)) { + el.classList.add('com-bitwarden-browser-animated-fill'); setTimeout(function () { - // START MODIFICATION - el && el.className && (el.className = el.className.replace(/(\\s)?com-bitwarden-browser-animated-fill/, '')); - // END MODIFICATION - }, styleTimeout)); + if (el) { + el.classList.remove('com-bitwarden-browser-animated-fill'); + } + }, styleTimeout); + } + // END MODIFICATION } document.elementForOPID = getElementByOpId;