mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-09-20 14:45:56 +08:00
Fix pasting multiline text inside checklist items [SCI-9881] (#6866)
This commit is contained in:
parent
395a214175
commit
4fd6ecf112
|
@ -35,12 +35,14 @@
|
|||
:attributeName="`${i18n.t('ChecklistItem')} ${i18n.t('name')}`"
|
||||
:editOnload="checklistItem.attributes.isNew"
|
||||
:smartAnnotation="true"
|
||||
:allowNewLine="true"
|
||||
@editingEnabled="enableTextEdit"
|
||||
@editingDisabled="disableTextEdit"
|
||||
@update="updateText"
|
||||
@delete="removeItem()"
|
||||
@keypress="keyPressHandler"
|
||||
@blur="onBlurHandler"
|
||||
@paste="pasteHandler"
|
||||
/>
|
||||
<span v-if="!editingText && (!checklistItem.attributes.urls || deleteUrl)" class="absolute right-0 top-0.5 leading-6 tw-hidden group-hover/checklist-item-header:inline-block !text-sn-blue cursor-pointer" @click="showDeleteModal" tabindex="0">
|
||||
<i class="sn-icon sn-icon-delete"></i>
|
||||
|
@ -164,10 +166,16 @@
|
|||
this.$emit('update', this.checklistItem, withKey);
|
||||
},
|
||||
keyPressHandler(e) {
|
||||
if (e.key === 'Enter' && e.shiftKey) {
|
||||
if (
|
||||
((e.shiftKey || e.metaKey) && e.key === 'Enter')
|
||||
|| ((e.ctrlKey || e.metaKey) && e.key === 'v')
|
||||
) {
|
||||
this.checklistItem.attributes.with_paragraphs = true;
|
||||
}
|
||||
},
|
||||
pasteHandler() {
|
||||
this.checklistItem.attributes.with_paragraphs = true;
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
@keydown="handleKeypress"
|
||||
@blur="handleBlur"
|
||||
@keyup.escape="cancelEdit && this.atWhoOpened"
|
||||
@paste="$emit('paste', e)"
|
||||
@focus="setCaretAtEnd"/>
|
||||
<textarea v-else
|
||||
ref="input"
|
||||
|
@ -29,6 +30,7 @@
|
|||
@keydown="handleKeypress"
|
||||
@blur="handleBlur"
|
||||
@keyup.escape="cancelEdit && this.atWhoOpened"
|
||||
@paste="$emit('paste', e)"
|
||||
@focus="setCaretAtEnd"/>
|
||||
</template>
|
||||
<div
|
||||
|
|
Loading…
Reference in a new issue