Ember-style select component. Mimics the behavior of a native <select>
element
as closely as possible.
Usage:
<FwSelect @content={{options}} @selection={{selection}} @action={{action "onChange"}} />
The above will render a select element with all of the options specified in content
and the option specified in selection
specified, if any.
content
ArrayArray of options to render. Importantly, these options should be objects, otherwise dropdown will not function as expeced.
Default: []
optionLabelPath
StringSpecifies the property of the element to be displayed as the text in the
Default: 'name'
optionValuePath
StringOptional key of the element to display as the "value" of the option element. Doesn't do anything in terms of functionality for this component.
Default: 'id'
prompt
StringIf you want there to be a prompt in the select (e.g. "Select an option..."), specify it here and it will be rendered as a disabled option in the first position.
promptEnabled
BooleanWhether or not the prompt can be selected as a valid option. This is useful if you want to allow the selection to be null.
Default: false
selection
ObjectIf there is an already selected object, specify it here and the select component will try to show it as the currently selected option.