diff --git a/addon/components/power-select.js b/addon/components/power-select.js index 865990c10..07fc3854a 100644 --- a/addon/components/power-select.js +++ b/addon/components/power-select.js @@ -1,5 +1,5 @@ import Component from '@ember/component'; -import { computed } from '@ember/object'; +import { getWithDefault, computed } from '@ember/object'; import { scheduleOnce } from '@ember/runloop'; import { getOwner } from '@ember/application'; import { isEqual } from '@ember/utils'; @@ -23,6 +23,9 @@ import { defaultTypeAheadMatcher } from '../utils/group-utils'; import { task, timeout } from 'ember-concurrency'; +import config from 'ember-get-config'; + +const globalConfig = config['ember-power-select']; // Import app config object // Copied from Ember. It shouldn't be necessary in Ember 2.5+ const assign = Object.assign || function EmberAssign(original, ...args) { @@ -76,7 +79,7 @@ export default Component.extend({ // Options searchEnabled: fallbackIfUndefined(true), - matchTriggerWidth: fallbackIfUndefined(true), + matchTriggerWidth: fallbackIfUndefined(getWithDefault(globalConfig, 'matchTriggerWidth', true)), preventScroll: fallbackIfUndefined(false), matcher: fallbackIfUndefined(defaultMatcher), loadingMessage: fallbackIfUndefined('Loading options...'), diff --git a/package.json b/package.json index 7117851f8..18f138ee3 100644 --- a/package.json +++ b/package.json @@ -43,6 +43,7 @@ "ember-cli-babel": "^6.10.0", "ember-cli-htmlbars": "^2.0.1", "ember-concurrency": "^0.8.12", + "ember-get-config": "^0.2.4", "ember-text-measurer": "^0.4.0", "ember-truth-helpers": "^2.0.0" },