diff --git a/src/components/Editor.vue b/src/components/Editor.vue index 40b9690f161..6c2d4d6c165 100644 --- a/src/components/Editor.vue +++ b/src/components/Editor.vue @@ -637,16 +637,10 @@ export default { onFocus() { this.emit('focus') - - // Make sure that the focus trap doesn't catch tab keys while being in the contenteditable - window._nc_focus_trap?.[0]?.pause() }, + onBlur() { this.emit('blur') - - // Hand back focus to the previous trap - window._nc_focus_trap?.[0]?.unpause() - this.$el.focus() }, onAddImageNode() { @@ -744,6 +738,15 @@ export default { this.$editor.commands.insertContent('\t') this.$editor.commands.focus() event.preventDefault() + event.stopPropagation() + return + } + + if (event.key === 'Tab') { + const possibleEditorTabCommand = this.$editor.can().sinkListItem() || this.$editor.can().liftListItem() || this.$editor.can().goToNextCell() || this.$editor.can().goToPreviousCell() + if (possibleEditorTabCommand) { + event.stopPropagation() + } return } diff --git a/src/components/Editor/ContentContainer.vue b/src/components/Editor/ContentContainer.vue index 9daf5e587e5..7cd40891399 100644 --- a/src/components/Editor/ContentContainer.vue +++ b/src/components/Editor/ContentContainer.vue @@ -30,8 +30,7 @@ -
diff --git a/src/css/prosemirror.scss b/src/css/prosemirror.scss index cd0f05ee362..a33b98e812d 100644 --- a/src/css/prosemirror.scss +++ b/src/css/prosemirror.scss @@ -13,6 +13,10 @@ div.ProseMirror { font-size: var(--default-font-size); outline: none; + &.ProseMirror-focused { + outline: 2px solid var(--color-main-text) !important; + } + :target { // Menubar height: 44px + 3px bottom + 3px top padding scroll-margin-top: 50px;