{"action":"created","issue":{"url":"https://api.github.com/repos/dockyard/ember-easy-form/issues/167","labels_url":"https://api.github.com/repos/dockyard/ember-easy-form/issues/167/labels{/name}","comments_url":"https://api.github.com/repos/dockyard/ember-easy-form/issues/167/comments","events_url":"https://api.github.com/repos/dockyard/ember-easy-form/issues/167/events","html_url":"https://github.com/dockyard/ember-easy-form/issues/167","id":44021326,"number":167,"title":"Multiple selects show validity incorrectly on focusOut()","user":{"login":"Truffula","id":2142218,"avatar_url":"https://avatars.githubusercontent.com/u/2142218?v=3","gravatar_id":"","url":"https://api.github.com/users/Truffula","html_url":"https://github.com/Truffula","followers_url":"https://api.github.com/users/Truffula/followers","following_url":"https://api.github.com/users/Truffula/following{/other_user}","gists_url":"https://api.github.com/users/Truffula/gists{/gist_id}","starred_url":"https://api.github.com/users/Truffula/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Truffula/subscriptions","organizations_url":"https://api.github.com/users/Truffula/orgs","repos_url":"https://api.github.com/users/Truffula/repos","events_url":"https://api.github.com/users/Truffula/events{/privacy}","received_events_url":"https://api.github.com/users/Truffula/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2014-09-26T08:03:23Z","updated_at":"2016-01-05T00:38:41Z","closed_at":"2016-01-05T00:38:41Z","body":"Since Ember.Select (with `multiple=true`) doesn't fire a change event when it gets updated, the validations don't get run until you submit the form. This has the side-effect that if the view generates with nothing selected on an attribute (a hasMany in this example) and there is a presence validation, then you select an option before un-focusing the field, it still shows a cannot-be-blank error.\r\n\r\nMy workaround at this stage is this (which could theoretically be worked into the existing `EasyForm.Input` or `EasyForm.Select` declarations, but it seems a bit of a hack (partly because it fires even if nothing changed):\r\n```js\r\nEmber.EasyForm.Input.reopen({\r\n  focusOut: function() {\r\n    if (this.as === 'select' && this.multiple) {\r\n      this.get('controller').propertyDidChange(this.selection);\r\n    }\r\n    return this._super.apply(this, arguments);\r\n  }\r\n});\r\n```\r\nI haven't managed to work out which events _do_ fire in this instance, but I thought it might be worth factoring in a different observer when the field is a `select multiple`.\r\n\r\nAnyway, thanks for the awesome libraries, love your work! :+1:"},"comment":{"url":"https://api.github.com/repos/dockyard/ember-easy-form/issues/comments/168854810","html_url":"https://github.com/dockyard/ember-easy-form/issues/167#issuecomment-168854810","issue_url":"https://api.github.com/repos/dockyard/ember-easy-form/issues/167","id":168854810,"user":{"login":"diogomafra","id":249335,"avatar_url":"https://avatars.githubusercontent.com/u/249335?v=3","gravatar_id":"","url":"https://api.github.com/users/diogomafra","html_url":"https://github.com/diogomafra","followers_url":"https://api.github.com/users/diogomafra/followers","following_url":"https://api.github.com/users/diogomafra/following{/other_user}","gists_url":"https://api.github.com/users/diogomafra/gists{/gist_id}","starred_url":"https://api.github.com/users/diogomafra/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/diogomafra/subscriptions","organizations_url":"https://api.github.com/users/diogomafra/orgs","repos_url":"https://api.github.com/users/diogomafra/repos","events_url":"https://api.github.com/users/diogomafra/events{/privacy}","received_events_url":"https://api.github.com/users/diogomafra/received_events","type":"User","site_admin":false},"created_at":"2016-01-05T00:38:41Z","updated_at":"2016-01-05T00:38:41Z","body":"As @grantovich noted, I think this is a issue with the select component itself, and not with the easy-form library."}}