Skip to content

Commit e39d843

Browse files
committed
fix(editor): support Cmd key for editor shortcuts on macOS
Editor keyboard shortcuts (save, delete, duplicate) only checked event.ctrlKey, so Cmd+D/Cmd+Enter/Cmd+Delete on macOS fell through to the browser's default shortcuts instead of triggering the calendar action. Fixes #8715 Signed-off-by: xhon-pelushi <xhon@pelushi.com>
1 parent 3c40915 commit e39d843

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/mixins/EditorMixin.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -634,17 +634,17 @@ export default {
634634
}
635635
},
636636
keyboardSaveEvent(event) {
637-
if (event.key === 'Enter' && event.ctrlKey === true && !this.isReadOnly && !this.canCreateRecurrenceException) {
637+
if (event.key === 'Enter' && (event.ctrlKey || event.metaKey) && !this.isReadOnly && !this.canCreateRecurrenceException) {
638638
this.saveAndLeave(false)
639639
}
640640
},
641641
keyboardDeleteEvent(event) {
642-
if (event.key === 'Delete' && event.ctrlKey === true && this.canDelete && !this.canCreateRecurrenceException) {
642+
if (event.key === 'Delete' && (event.ctrlKey || event.metaKey) && this.canDelete && !this.canCreateRecurrenceException) {
643643
this.deleteAndLeave(false)
644644
}
645645
},
646646
keyboardDuplicateEvent(event) {
647-
if (event.key === 'd' && event.ctrlKey === true) {
647+
if (event.key === 'd' && (event.ctrlKey || event.metaKey)) {
648648
event.preventDefault()
649649
if (!this.isNew && !this.isReadOnly && !this.canCreateRecurrenceException) {
650650
this.duplicateEvent()

0 commit comments

Comments
 (0)