mirror of
https://github.com/discourse/discourse.git
synced 2024-11-27 11:53:44 +08:00
FIX: Hide popup-menu options when typing.
This commit is contained in:
parent
a053caeda4
commit
fd800b544f
|
@ -7,6 +7,10 @@ export default Ember.Component.extend({
|
|||
_setup() {
|
||||
this.appEvents.on("popup-menu:open", this, "_changeLocation");
|
||||
|
||||
$('html').on(`keydown.popup-menu-${this.get('elementId')}`, () => {
|
||||
this.sendAction('hide');
|
||||
});
|
||||
|
||||
$('html').on(`mouseup.popup-menu-${this.get('elementId')}`, (e) => {
|
||||
const $target = $(e.target);
|
||||
if ($target.is("button") || this.$().has($target).length === 0) {
|
||||
|
@ -18,6 +22,7 @@ export default Ember.Component.extend({
|
|||
@on('willDestroyElement')
|
||||
_cleanup() {
|
||||
$('html').off(`mouseup.popup-menu-${this.get('elementId')}`);
|
||||
$('html').off(`keydown.popup-menu-${this.get('elementId')}`);
|
||||
this.appEvents.off("popup-menu:open", this, "_changeLocation");
|
||||
},
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user