Skip to content

Commit

Permalink
Handle native bold, italic, underline in editor
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidMStraub committed Aug 27, 2023
1 parent bb51817 commit b8747e0
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/components/GrampsjsEditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,9 @@ class GrampsjsEditor extends GrampsjsTranslateMixin(LitElement) {
'deleteContentForward',
'insertFromPaste',
'deleteByCut',
'formatBold',
'formatItalic',
'formatUnderline',
].includes(e.inputType)
) {
const div = this.shadowRoot.querySelector('div.note')
Expand Down Expand Up @@ -266,6 +269,12 @@ class GrampsjsEditor extends GrampsjsTranslateMixin(LitElement) {
nCharBefore2 + range.endOffset
)
this.cursorPosition = [nCharBefore1 + range.startOffset]
} else if (e.inputType === 'formatBold') {
this._handleFormat('bold')
} else if (e.inputType === 'formatItalic') {
this._handleFormat('italic')
} else if (e.inputType === 'formatUnderline') {
this._handleFormat('underline')
}
} else {
// eslint-disable-next-line no-console
Expand Down

0 comments on commit b8747e0

Please sign in to comment.