Work around Firefox bug affecting LazyMultilineTextInputWidget

Before the `height: 2.5em` was applied to _both_ the visible
<textarea> and the $clone. While this shouldn't make a difference –
one of the first things .adjustSize() does is setting the $clones
height to 0 – it somehow triggered that Firefox bug.

With this patch we remove the `height: 2.5em` before handing over to
OOUI's .adjustSize(). It looks like this fixes the issue. We might
be able to revert I7560ceb then.

Bug: T317369
Change-Id: I96c2d7d7bf359ff0373d478b2b7e97c8833ba5b6
This commit is contained in:
thiemowmde 2023-01-20 12:20:34 +01:00
parent 145a55934a
commit 004d92d341
2 changed files with 3 additions and 1 deletions

View file

@ -31,6 +31,6 @@
color: #54595d;
}
.ve-ui-mwParameterPage .oo-ui-textInputWidget textarea {
.ve-ui-mwLazyMultilineTextInputWidget-collapsed {
height: 2.5em;
}

View file

@ -30,8 +30,10 @@ ve.ui.MWLazyMultilineTextInputWidget = function VeUiMWLazyMultilineTextInputWidg
// Check autosize is set, but if it isn't you probably shouldn't be using this widget!
if ( this.autosize ) {
this.$input.addClass( 've-ui-mwLazyMultilineTextInputWidget-collapsed' );
this.autosize = false;
this.$input.one( 'focus', function () {
widget.$input.removeClass( 've-ui-mwLazyMultilineTextInputWidget-collapsed' );
widget.autosize = true;
widget.adjustSize();
} );