diff --git a/addon/components/frost-select.js b/addon/components/frost-select.js index 71ee1a71..2d5a2de1 100644 --- a/addon/components/frost-select.js +++ b/addon/components/frost-select.js @@ -117,10 +117,12 @@ export default Component.extend(PropTypeMixin, { } if (typeOf(selected) === 'array') { - return selected.map((itemIndex) => items[itemIndex]) + return selected + .filter((itemIndex) => itemIndex >= 0 && itemIndex < items.length) + .map((itemIndex) => items[itemIndex]) } - if (selected) { + if (selected ** selected <= 0 && selected < items.length) { return [items[selected]] }