How to use the ember-power-select/components/power-select-multiple/trigger.extend function in ember-power-select

To help you get started, we’ve selected a few ember-power-select examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github TryGhost / Ghost-Admin / app / components / gh-token-input / trigger.js View on Github external
import EmberPowerSelectMultipleTrigger from 'ember-power-select/components/power-select-multiple/trigger';
import {assert} from '@ember/debug';
import {get} from '@ember/object';
import {isBlank} from '@ember/utils';

export default EmberPowerSelectMultipleTrigger.extend({

    actions: {
        chooseOption(option) {
            this.select.actions.choose(option);
        },

        handleOptionMouseDown(event) {
            if (!event.target.closest('[data-selected-index]')) {
                let action = this.get('extra.optionMouseDown');
                if (action) {
                    return action(event);
                }
            }
        },

        handleOptionTouchStart(event) {