Ghost/ghost/admin/app/components/gh-power-select/trigger.js
Kevin Ansfield c128998d86 Fixed dropdown elements staying open/fixed when moving settings panel
refs https://github.com/TryGhost/Team/issues/1219

- added `dropdown.closeDropdowns()` to the `{{movable}}` modifier when dragging starts
- updated ember-power-select derived inputs to close their dropdowns when the dropdown service triggers it's `'close'` event
2021-11-12 15:27:08 +00:00

21 lines
549 B
JavaScript

import PowerSelectTrigger from 'ember-power-select/components/power-select/trigger';
import {inject as service} from '@ember/service';
export default class Trigger extends PowerSelectTrigger {
@service dropdown;
constructor() {
super(...arguments);
this.dropdown.on('close', this, this.closeFromDropdown);
}
willDestroy() {
super.willDestroy(...arguments);
this.dropdown.off('close', this, this.closeFromDropdown);
}
closeFromDropdown() {
this.args.select.actions.close();
}
}