Focus event in Ember.Select view

I used Ember.Select viewas follows.

{{view "select" content=people
                optionLabelPath="content.fullName"
                optionValuePath="content.id"
                prompt="Pick a person:"
                selection=selectedPerson}}

Now I want to add an focus-out="showErrors"event listener to this kind of selection in order to handle some validation. This works great with Ember.TextField and Ember.TextArea. But I noticed that it focus-outdoes not work with the Ember.Select view.

It would be very nice if someone can solve the problem of this problem

+4
source share
1 answer

Could you add an observer to selectedPerson so that when the value of the dropdown value changes, it triggers your check.

Older syntax:

validatePersonChange: function(){
   //do validation here
  }.observes('selectedPerson')

New syntax:

const { observer } = Ember;
...
validatePersonChange: observer('selectedPerson', function(){
    //do validation
  })
0
source

All Articles