FIX: stops bookmark keybaod event to be propagated into modal (#9457)

This commit is contained in:
Joffrey JAFFEUX 2020-04-17 10:05:51 +02:00 committed by GitHub
parent 8f0544137a
commit 17c0c9652d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 6 deletions

View File

@ -1,6 +1,5 @@
import { and } from "@ember/object/computed"; import { and } from "@ember/object/computed";
import { isPresent } from "@ember/utils"; import { isPresent } from "@ember/utils";
import { next } from "@ember/runloop";
import Controller from "@ember/controller"; import Controller from "@ember/controller";
import { Promise } from "rsvp"; import { Promise } from "rsvp";
import ModalFunctionality from "discourse/mixins/modal-functionality"; import ModalFunctionality from "discourse/mixins/modal-functionality";
@ -77,10 +76,6 @@ export default Controller.extend(ModalFunctionality, {
if (this.editingExistingBookmark()) { if (this.editingExistingBookmark()) {
this.initializeExistingBookmarkData(); this.initializeExistingBookmarkData();
} else {
// make sure the input is cleared, otherwise the keyboard shortcut to toggle
// bookmark for post ends up in the input
next(() => this.set("model.name", null));
} }
}, },

View File

@ -174,7 +174,10 @@ export default {
this.pause(Object.keys(combinations)); this.pause(Object.keys(combinations));
}, },
toggleBookmark() { toggleBookmark(event) {
event.preventDefault();
event.stopPropagation();
this.sendToSelectedPost("toggleBookmark"); this.sendToSelectedPost("toggleBookmark");
this.sendToTopicListItemView("toggleBookmark"); this.sendToTopicListItemView("toggleBookmark");
}, },