Make multiline text fields auto-size depending on the value

This avoids a series of issues on the "Embed" tab, for both the
"Wikitext" and the "HTML" snippet. Without this patch, the textareas
might show a resize handle that does have weird effects when used.
Sometimes the textarea contains very few text and empty space,
sometimes a long text that is barely visible. Auto-fitting it to the
content feels like the right thing to do here.

Change-Id: Ieeaf4d33fef8eb3660fb177f57dfb753b8c208f8
This commit is contained in:
Thiemo Kreuz 2019-05-19 14:59:43 +02:00
parent e1caa0f65e
commit 646d871eee

View file

@ -119,7 +119,9 @@
this.embedTextHtml = new OO.ui.MultilineTextInputWidget( {
classes: htmlClasses,
readOnly: true
readOnly: true,
autosize: true,
maxRows: 5
} );
this.embedTextHtml.$element.find( 'textarea' )
@ -131,7 +133,9 @@
this.embedTextWikitext = new OO.ui.MultilineTextInputWidget( {
classes: wikitextClasses,
readOnly: true
readOnly: true,
autosize: true,
maxRows: 5
} );
this.embedTextWikitext.$element.find( 'textarea' )