Skip to content
This repository was archived by the owner on Nov 28, 2022. It is now read-only.

Commit 5192cff

Browse files
committed
Koenig - Fixed /-menu Enter card creation
refs TryGhost/Ghost#9724 - e16a300 introduced a bug because it expected an event param that is only available when clicking - add guard to check for `event` presence before attempting to stop propagation
1 parent 055a39a commit 5192cff

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lib/koenig-editor/addon/components/koenig-slash-menu.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,10 @@ export default Component.extend({
9696
// make sure the click doesn't propagate and get picked up by the
9797
// newly inserted card which can then remove itself because it
9898
// looks like a click outside of an empty card
99-
event.preventDefault();
100-
event.stopImmediatePropagation();
99+
if (event) {
100+
event.preventDefault();
101+
event.stopImmediatePropagation();
102+
}
101103

102104
// params are order-dependent and listed in CARD_MENU for each card
103105
if (!isEmpty(item.params) && !isEmpty(params)) {

0 commit comments

Comments
 (0)