Quantcast
Channel: Ember.JS - Latest topics
Viewing all articles
Browse latest Browse all 4870

[Solved] Ember Power Select - selection not highlighted

$
0
0

The correct value shows in the field but when clicking the dropdown, the first item is highlighted. image

<PowerSelect
  @renderInPlace={{true}}
  @selected={{this.destination}}
  @onChange={{this.select}}
  @options={{@states}} as |state|
 >
      {{state.name}}
    </PowerSelect>


export default class PropertiesPropertyEditAddressComponent extends Component {
  @tracked destination = null;

  constructor() {
    super(...arguments);
    this.destination = this.args.property.address.state;
  }

  @action
  select(value) {
    this.destination = value;
    set(this.args.property.address, "state", value);
  }
}

@states is an array of state objects…such as { name: 'Alaska', abbreviation: 'AK' }.

3 posts - 2 participants

Read full topic


Viewing all articles
Browse latest Browse all 4870

Trending Articles