FleetbaseFleetbase

MultiSelect

<MultiSelect> is a multi-value typeahead select. Thin wrapper around ember-power-select's PowerSelectMultiple.

<MultiSelect>

A multi-value typeahead select. Thin wrapper around ember-power-select's <PowerSelectMultiple> with Fleetbase's form styling.

For Ember Data records, prefer <ModelSelectMultiple>.

Basic Usage

<MultiSelect
  @options={{this.tagOptions}}
  @selected={{this.selectedTags}}
  @placeholder="Add tags…"
  @onChange={{fn (mut this.selectedTags)}}
  as |tag|
>
  {{tag}}
</MultiSelect>

Arguments

ArgumentTypeDescription
@optionsarrayThe options to choose from
@selectedarrayThe currently-selected options
@onChange(selected)Called with the new array on every change
@placeholderstringPlaceholder for the empty state
@allowClearbooleanShow a clear-all button
@searchEnabledbooleanEnable typeahead search
@searchfunctionCustom async search function
@selectClassstringExtra classes on the trigger
@registerAPIfunctionCapture the power-select API
@placeholderComponentstringCustom placeholder component
@preventScrollbooleanDisable body scroll when open
@renderInPlacebooleanRender in DOM order vs. portal
@scrollTofunctionCustom scroll-to-option behavior

The yielded value is the option being rendered.

See Also

Source

FileDescription
addon/components/multi-select.hbsTemplate (template-only)
MultiSelect | Fleetbase