Bartosz Dziewoński has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/175743

Change subject: Window: Disable transitions when changing window height to 
calculate content height
......................................................................

Window: Disable transitions when changing window height to calculate content 
height

Otherwise we're getting values from when the window height is animating,
which manifests itself as dialogs that are just barely not high enough.

Bug: T72061
Change-Id: I624f1b0da906200abefbbf914172b8794cdf4d1b
---
M src/Window.js
1 file changed, 7 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/oojs/ui refs/changes/43/175743/1

diff --git a/src/Window.js b/src/Window.js
index 620bb81..3ef81f7 100644
--- a/src/Window.js
+++ b/src/Window.js
@@ -308,11 +308,16 @@
  * @return {number} Content height
  */
 OO.ui.Window.prototype.getContentHeight = function () {
-       // Temporarily resize the frame so getBodyHeight() can use scrollHeight 
measurements
-       var bodyHeight, oldHeight = this.$frame[0].style.height;
+       // Temporarily resize the frame so getBodyHeight() can use scrollHeight 
measurements.
+       // Disable transitions first, otherwise we'll get values from when the 
window was animating.
+       var bodyHeight, oldHeight, oldTransition;
+       oldTransition = this.$frame[0].style.transition;
+       this.$frame[0].style.transition = 'none';
+       oldHeight = this.$frame[0].style.height;
        this.$frame[0].style.height = '1px';
        bodyHeight = this.getBodyHeight();
        this.$frame[0].style.height = oldHeight;
+       this.$frame[0].style.transition = oldTransition;
 
        return Math.round(
                // Add buffer for border

-- 
To view, visit https://gerrit.wikimedia.org/r/175743
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I624f1b0da906200abefbbf914172b8794cdf4d1b
Gerrit-PatchSet: 1
Gerrit-Project: oojs/ui
Gerrit-Branch: master
Gerrit-Owner: Bartosz Dziewoński <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to