Simple variation of ember-power-select that allows you to create a new entry based on the search text.
ember install ember-power-select-with-create
For more options please refer to the ember-power-select docs
You can provide a callback showCreateWhen
, which will be called whenever the user types into the search field.
If you return true
, the create option will be shown. If you return false
, it won't be shown.
actions: {
hideCreateOptionOnSameName(term) {
let existingOption = this.get('countries').findBy('name', term);
return !existingOption;
},
},