From 5fc19ef9a43bafddff36686b51876940db6ddfcc Mon Sep 17 00:00:00 2001 From: Avital Oliver Date: Tue, 2 Oct 2012 22:08:15 -0700 Subject: [PATCH] Fix redraw artifact in chrome with accounts-ui --- packages/accounts-ui-unstyled/login_buttons.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/packages/accounts-ui-unstyled/login_buttons.js b/packages/accounts-ui-unstyled/login_buttons.js index 9aef68559c..23c45781eb 100644 --- a/packages/accounts-ui-unstyled/login_buttons.js +++ b/packages/accounts-ui-unstyled/login_buttons.js @@ -168,6 +168,18 @@ document.getElementById('login-email').value = usernameOrEmail; document.getElementById('login-password').value = password; + + // Forge redrawing the `login-dropdown-list` element because of + // a bizarre Chrome bug in which part of the DIV is not redrawn + // in case you had tried to unsuccessfully log in before + // switching to the signup form. + // + // Found tip on how to force a redraw on + // http://stackoverflow.com/questions/3485365/how-can-i-force-webkit-to-redraw-repaint-to-propagate-style-changes/3485654#3485654 + var redraw = document.getElementById('login-dropdown-list'); + redraw.style.display = 'none'; + redraw.offsetHeight; // it seems that this line does nothing but is necessary for the redraw to work + redraw.style.display = 'block'; }, 'click #forgot-password-link': function () { resetMessages();