summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/content_editor/components
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2022-10-03 21:09:57 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2022-10-03 21:09:57 +0000
commitb8fcc8edb4a289ef3ef4fee0ed8fd88e853a2396 (patch)
tree31658d7760d36aa3b368e020e08f4d21c678f2e3 /app/assets/javascripts/content_editor/components
parentd83bbccfcd07ddab93be73959e3b149b75831e28 (diff)
downloadgitlab-ce-b8fcc8edb4a289ef3ef4fee0ed8fd88e853a2396.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/content_editor/components')
-rw-r--r--app/assets/javascripts/content_editor/components/content_editor.vue7
-rw-r--r--app/assets/javascripts/content_editor/components/editor_state_observer.vue4
2 files changed, 8 insertions, 3 deletions
diff --git a/app/assets/javascripts/content_editor/components/content_editor.vue b/app/assets/javascripts/content_editor/components/content_editor.vue
index b5a88f97d83..22381377389 100644
--- a/app/assets/javascripts/content_editor/components/content_editor.vue
+++ b/app/assets/javascripts/content_editor/components/content_editor.vue
@@ -150,7 +150,12 @@ export default {
<template>
<content-editor-provider :content-editor="contentEditor">
<div>
- <editor-state-observer @docUpdate="notifyChange" @focus="focus" @blur="blur" />
+ <editor-state-observer
+ @docUpdate="notifyChange"
+ @focus="focus"
+ @blur="blur"
+ @keydown="$emit('keydown', $event)"
+ />
<content-editor-alert />
<div
data-testid="content-editor"
diff --git a/app/assets/javascripts/content_editor/components/editor_state_observer.vue b/app/assets/javascripts/content_editor/components/editor_state_observer.vue
index 41c3771bf41..ccb46e3b593 100644
--- a/app/assets/javascripts/content_editor/components/editor_state_observer.vue
+++ b/app/assets/javascripts/content_editor/components/editor_state_observer.vue
@@ -1,6 +1,6 @@
<script>
import { debounce } from 'lodash';
-import { ALERT_EVENT } from '../constants';
+import { ALERT_EVENT, KEYDOWN_EVENT } from '../constants';
export const tiptapToComponentMap = {
update: 'docUpdate',
@@ -10,7 +10,7 @@ export const tiptapToComponentMap = {
blur: 'blur',
};
-export const eventHubEvents = [ALERT_EVENT];
+export const eventHubEvents = [ALERT_EVENT, KEYDOWN_EVENT];
const getComponentEventName = (tiptapEventName) => tiptapToComponentMap[tiptapEventName];