$.ig.EditorProviderInput = $.ig.EditorProviderInput || $.ig.EditorProvider.extend({
createEditor: function (callbacks, key, editorOptions, tabIndex, format, element) {
// Use a textarea element for multiline editing instead of input
element = element || $('<textarea/>');
// Set necessary attributes for the textarea
element.attr({
rows: 3, // Set rows as needed for your multiline editor
cols: 30, // Set columns as needed for your multiline editor
});
// Call parent createEditor
this._super(callbacks, key, editorOptions, tabIndex, format, element);
element.on('keydown', $.proxy(this.keyDown, this));
this.editor = {};
this.editor.element = element;
return element;
},
keyDown: function (evt) {
var ui = {};
ui.owner = this.editor.element;
ui.owner.element = this.editor.element;
this.callbacks.keyDown(evt, ui, this.columnKey);
},
setSize: function (width, height) {
this.editor.element.css({
width: width - 2,
height: height - 2,
borderWidth: '1px'
});
},
attachErrorEvents: function (errorShowing, errorShown, errorHidden) { },
getValue: function () {
return this.editor.element.val();
},
setValue: function (val) {
// If val is an object, set the displayValue, otherwise set the string value
if (val !== null && typeof val !== 'string') {
this.editor.element.val(val.displayValue);
} else if (val !== null && val !== undefined) {
// Replace <br/> with \n for editing in textarea
...
Please Whitelist JSFiddle in your content blocker.
Help keep JSFiddle free for always by one of two ways:
Whitelist JSFiddle in your content blocker (two clicks)
Go PRO and get access to additional PRO features →
Join the 4+ million users, and keep the JSFiddle dream alive.
Ad-free
All ads in the editor and listing pages are turned completely off.
Use pre-released features
You get to try and use features (like the Palette Color Generator) months before everyone else.
Fiddle collections
Sort and categorize your Fiddles into multiple collections.
Private collections and fiddles
You can make as many Private Fiddles, and Private Collections as you wish!
Console
Debug your Fiddle with a minimal built-in JavaScript console.