mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-10-08 04:47:22 +08:00
Merge pull request #4282 from aignatov-bio/ai-sci-7008-fix-enter-button-on-checklist-item
Allow multiline in checklist items [SCI-7008]
This commit is contained in:
commit
cc47d2718f
3 changed files with 12 additions and 8 deletions
|
@ -28,6 +28,7 @@
|
||||||
|
|
||||||
.sci-inline-edit__view {
|
.sci-inline-edit__view {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
|
white-space: pre-wrap;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
|
||||||
&.blank {
|
&.blank {
|
||||||
|
|
|
@ -26,6 +26,8 @@
|
||||||
:multilinePaste="true"
|
:multilinePaste="true"
|
||||||
:editOnload="checklistItem.attributes.isNew"
|
:editOnload="checklistItem.attributes.isNew"
|
||||||
:smartAnnotation="true"
|
:smartAnnotation="true"
|
||||||
|
:saveOnEnter="false"
|
||||||
|
:allowNewLine="true"
|
||||||
@editingEnabled="enableTextEdit"
|
@editingEnabled="enableTextEdit"
|
||||||
@editingDisabled="disableTextEdit"
|
@editingDisabled="disableTextEdit"
|
||||||
@update="updateText"
|
@update="updateText"
|
||||||
|
|
|
@ -40,6 +40,8 @@
|
||||||
characterLimit: { type: Number },
|
characterLimit: { type: Number },
|
||||||
placeholder: { type: String },
|
placeholder: { type: String },
|
||||||
autofocus: { type: Boolean, default: false },
|
autofocus: { type: Boolean, default: false },
|
||||||
|
saveOnEnter: { type: Boolean, default: true },
|
||||||
|
allowNewLine: { type: Boolean, default: false },
|
||||||
multilinePaste: { type: Boolean, default: false },
|
multilinePaste: { type: Boolean, default: false },
|
||||||
smartAnnotation: { type: Boolean, default: false },
|
smartAnnotation: { type: Boolean, default: false },
|
||||||
editOnload: { type: Boolean, default: false }
|
editOnload: { type: Boolean, default: false }
|
||||||
|
@ -134,17 +136,16 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
handleInput() {
|
handleInput() {
|
||||||
this.newValue = this.newValue.replace(/^[\n\r]+|[\n\r]+$/g, '');
|
if (!this.allowNewLine) {
|
||||||
|
this.newValue = this.newValue.replace(/^[\n\r]+|[\n\r]+$/g, '');
|
||||||
|
}
|
||||||
this.$nextTick(this.resize);
|
this.$nextTick(this.resize);
|
||||||
},
|
},
|
||||||
handleKeypress(e) {
|
handleKeypress(e) {
|
||||||
switch(e.key) {
|
if (e.key == 'Escape') {
|
||||||
case 'Escape':
|
this.cancelEdit();
|
||||||
this.cancelEdit();
|
} else if (e.key == 'Enter' && this.saveOnEnter) {
|
||||||
break;
|
this.update();
|
||||||
case 'Enter':
|
|
||||||
this.update();
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
resize() {
|
resize() {
|
||||||
|
|
Loading…
Add table
Reference in a new issue