diff --git a/app/assets/javascripts/discourse/lib/keyboard-shortcuts.js b/app/assets/javascripts/discourse/lib/keyboard-shortcuts.js index 9a3aff88a40..2ce05f463ba 100644 --- a/app/assets/javascripts/discourse/lib/keyboard-shortcuts.js +++ b/app/assets/javascripts/discourse/lib/keyboard-shortcuts.js @@ -283,11 +283,13 @@ export default { }); }, - createTopic() { + createTopic(event) { if (!(this.currentUser && this.currentUser.can_create_topic)) { return; } + event.preventDefault(); + // If the page has a create-topic button, use it for context sensitive attributes like category let $createTopicButton = $("#create-topic"); if ($createTopicButton.length) {