diff --git a/src/api/forms/components/FormProperties.vue b/src/api/forms/components/FormProperties.vue index 1e4bdf30bb0..efe219a803f 100644 --- a/src/api/forms/components/FormProperties.vue +++ b/src/api/forms/components/FormProperties.vue @@ -129,6 +129,7 @@ export default { } }, mounted() { + document.addEventListener('keydown', this.handleKeyDown); this.formSections = this.model.sections.map((section) => { section.id = uuid(); @@ -141,6 +142,9 @@ export default { return section; }); }, + unmounted() { + document.removeEventListener('keydown', this.handleKeyDown); + }, methods: { onChange(data) { this.invalidProperties[data.model.key] = data.invalid; @@ -152,6 +156,13 @@ export default { }, onSave() { this.$emit('on-save'); + }, + handleKeyDown({ key }) { + if (key === 'Enter' && !this.isInvalid) { + this.onSave(); + } else if (key === 'Escape') { + this.onCancel(); + } } } }; diff --git a/src/api/menu/components/SuperMenu.vue b/src/api/menu/components/SuperMenu.vue index cd8d72f7be3..754cc2f4605 100644 --- a/src/api/menu/components/SuperMenu.vue +++ b/src/api/menu/components/SuperMenu.vue @@ -26,53 +26,66 @@ :class="[options.menuClass, 'c-super-menu']" :style="styleObject" > -