Edit-text widget: rows parameter takes precedence, CM accepts rows now (#9454)

* edit-text rows parameter takes precedence, CM accepts rows now

* Add changenote for PR

* Clarify edit-text widget rows parameter precedence
This commit is contained in:
Mario Pietsch
2025-12-17 16:03:23 +01:00
committed by GitHub
parent 7c197f6ecc
commit 86d61e09bd
5 changed files with 31 additions and 18 deletions

View File

@@ -122,7 +122,7 @@ function CodeMirrorEngine(options) {
self.widget.invokeActionString(self.widget.editInputActions,this,event,{actionValue: this.getText()});
}
});
this.cm.on("drop",function(cm,event) {
if(!self.widget.isFileDropEnabled) {
event.stopPropagation(); // Otherwise TW's dropzone widget sees the drop event
@@ -257,7 +257,10 @@ CodeMirrorEngine.prototype.getText = function() {
Fix the height of textarea to fit content
*/
CodeMirrorEngine.prototype.fixHeight = function() {
if(this.widget.editAutoHeight) {
// rows takes precedence
if(this.widget.editRows) {
this.cm.setSize(null,this.widget.editRows + "em");
} else if(this.widget.editAutoHeight) {
// Resize to fit
this.cm.setSize(null,null);
} else {