Merge "Media Dialog: make the alt field wrap and autosize for longer values"

This commit is contained in:
jenkins-bot 2023-10-26 12:48:31 +00:00 committed by Gerrit Code Review
commit 60b7420e3f

View file

@ -230,9 +230,12 @@ ve.ui.MWMediaDialog.prototype.initialize = function () {
this.captionFieldset.addItems( [ captionField ] );
// Alt text
this.altTextInput = new OO.ui.TextInputWidget( {
this.altTextInput = new OO.ui.MultilineTextInputWidget( {
spellcheck: true,
classes: [ 've-ui-mwMediaDialog-altText' ]
classes: [ 've-ui-mwMediaDialog-altText' ],
autosize: true,
rows: 1,
allowLinebreaks: false
} );
var altTextField = new OO.ui.FieldLayout( this.altTextInput, {
align: 'top'
@ -1201,6 +1204,9 @@ ve.ui.MWMediaDialog.prototype.switchPanels = function ( panel, noFocus ) {
// Focus the caption surface
this.captionTarget.focus();
}
// Auto-sized alt text field is populated while hidden,
// so force a manual resize now.
this.altTextInput.adjustSize( true );
break;
case 'search':
this.setSize( 'larger' );