Skip to content

Commit

Permalink
Enable cut & paste in editor
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidMStraub committed Aug 26, 2023
1 parent 9714d67 commit 0bc63b5
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/components/GrampsjsEditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,7 @@ class GrampsjsEditor extends GrampsjsTranslateMixin(LitElement) {
'deleteContentBackward',
'deleteContentForward',
'insertFromPaste',
'deleteByCut',
].includes(e.inputType)
) {
const div = this.shadowRoot.querySelector('div.note')
Expand All @@ -253,7 +254,11 @@ class GrampsjsEditor extends GrampsjsTranslateMixin(LitElement) {
this._insertText('\n', nCharBefore1 + range.startOffset)
this.cursorPosition = [nCharBefore1 + range.startOffset + 1]
} else if (
['deleteContentBackward', 'deleteContentForward'].includes(e.inputType)
[
'deleteContentBackward',
'deleteContentForward',
'deleteByCut',
].includes(e.inputType)
) {
const nCharBefore2 = getNumCharBeforeNode(range.endContainer, div)[0]
this._deleteText(
Expand Down

0 comments on commit 0bc63b5

Please sign in to comment.