Skip to content

Commit ceed43e

Browse files
committed
textEditor with enter
1 parent acb07bc commit ceed43e

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

services/static-webserver/client/source/class/osparc/editor/MarkdownEditor.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ qx.Class.define("osparc.editor.MarkdownEditor", {
4646
compact: {
4747
check: "Boolean",
4848
init: null,
49-
apply: "__applyCompact"
49+
apply: "__applyCompact",
5050
}
5151
},
5252

services/static-webserver/client/source/class/osparc/editor/TextEditor.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,15 @@ qx.Class.define("osparc.editor.TextEditor", {
3232
}
3333

3434
this.__addButtons();
35+
36+
this.addListener("keydown", e => {
37+
if (e.isCtrlPressed() && e.getKeyIdentifier() === "Enter") {
38+
const text = this.getChildControl("text-area").getValue();
39+
this.fireDataEvent("textChanged", text);
40+
e.stopPropagation();
41+
e.preventDefault();
42+
}
43+
}, this);
3544
},
3645

3746
events: {

0 commit comments

Comments
 (0)