Some captions can be quite long:
Description
Description
Details
Details
Subject | Repo | Branch | Lines +/- | |
---|---|---|---|---|
Make gallery dialog caption field multiline | mediawiki/extensions/VisualEditor | master | +5 -3 |
Event Timeline
Comment Actions
Change 297612 had a related patch set uploaded (by Tchanders):
Make gallery dialog caption field multiline
Comment Actions
@matmarex Good point - I think the multiline input is useful for seeing the whole caption at once if it's long, but we could prevent entering line breaks?
Comment Actions
We have the same problem in the save dialog, and solve it using the inputFilter option, and a keypress handler:
this.editSummaryInput = new OO.ui.TextInputWidget( { multiline: true, placeholder: ve.msg( 'visualeditor-editsummary' ), classes: [ 've-ui-mwSaveDialog-summary' ], inputFilter: function ( value ) { // Prevent the user from inputting newlines (this kicks in on paste, etc.) return value.replace( /\r?\n/g, ' ' ); } } ); // Prevent the user from inputting newlines from keyboard this.editSummaryInput.$input.on( 'keypress', function ( e ) { if ( e.which === OO.ui.Keys.ENTER ) { e.preventDefault(); } } );