Fix the bouncing effect when opening the sign in dialog
The sign in dialog calls onResize during its constructor, which winds up where in AutoCenterDialogBox.center(). When center() gets called on an unattached dialog, it attaches it to the UI, causing it to show earlier than we wanted it to. By only recentering the dialogs when they are actually attached to the browser DOM we avoid the bouncing problem, as the dialog doesn't display early. Signed-off-by: Shawn O. Pearce <sop@google.com>
This commit is contained in:
@@ -56,6 +56,8 @@ public class AutoCenterDialogBox extends DialogBox {
|
||||
}
|
||||
|
||||
protected void onResize(final int width, final int height) {
|
||||
center();
|
||||
if (isAttached()) {
|
||||
center();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user