{"action":"closed","issue":{"url":"https://api.github.com/repos/martndemus/ember-form-for/issues/136","repository_url":"https://api.github.com/repos/martndemus/ember-form-for","labels_url":"https://api.github.com/repos/martndemus/ember-form-for/issues/136/labels{/name}","comments_url":"https://api.github.com/repos/martndemus/ember-form-for/issues/136/comments","events_url":"https://api.github.com/repos/martndemus/ember-form-for/issues/136/events","html_url":"https://github.com/martndemus/ember-form-for/issues/136","id":194661841,"number":136,"title":"2.0.0-alpha.13:`select-field` sending obj rather than obj.value on update","user":{"login":"kevlarr","id":6306496,"avatar_url":"https://avatars.githubusercontent.com/u/6306496?v=3","gravatar_id":"","url":"https://api.github.com/users/kevlarr","html_url":"https://github.com/kevlarr","followers_url":"https://api.github.com/users/kevlarr/followers","following_url":"https://api.github.com/users/kevlarr/following{/other_user}","gists_url":"https://api.github.com/users/kevlarr/gists{/gist_id}","starred_url":"https://api.github.com/users/kevlarr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kevlarr/subscriptions","organizations_url":"https://api.github.com/users/kevlarr/orgs","repos_url":"https://api.github.com/users/kevlarr/repos","events_url":"https://api.github.com/users/kevlarr/events{/privacy}","received_events_url":"https://api.github.com/users/kevlarr/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-12-09T18:14:02Z","updated_at":"2016-12-14T21:44:07Z","closed_at":"2016-12-14T21:44:07Z","body":"Say I have the following array on a component...\r\n\r\n```\r\ncharacters: [\r\n  { ship: 'Serenity', name: 'Malcom Reynolds', value: 'reynolds' },\r\n  { ship: 'Serenity', name: 'Jayne Cobb', value: 'cobber' },\r\n  { ship: 'Nostromo', name: 'Ellen Ripley', value: 'rippers' },\r\n  { ship: 'Millennium Falcon', name: 'Han Solo', value: 'han_solo' },\r\n  ...\r\n]\r\n```\r\n\r\n... and I'm using it in a form like so.\r\n\r\n```\r\n{{#form-for myFavoriteThings as |f|}}\r\n  {{f.select-field \"character\" characters\r\n    groupLabelPath=\"ship\"\r\n    optionLabelPath=\"name\"\r\n    optionValuePath=\"value\"\r\n  }}\r\n{{/form-for}}\r\n```\r\n\r\nThis correctly (and awesomely!) renders my `<select>` input complete with option groups of characters arranged by their respective ship.\r\n\r\n```\r\n<select>\r\n  <optgroup label=\"Serenity\">\r\n          <option value=\"reynolds\">Malcom Reynolds</option>\r\n          ...\r\n  </optgroup>\r\n  ...\r\n</select>\r\n```\r\n\r\nThe label displayed for each option is correct, as is the value assigned to the option.\r\n\r\nWhen I click an option, however, an **entire Ember object** (generated somewhere in `fields-for`) is passed to the update function, rather than the specific value assigned to the `<option>` extracted by `optionValuePath`.\r\n\r\nUnless I override this with my own update function to conditionally check if the value argument is an object, it sets `myFavoriteThings` to...\r\n```\r\n{\r\n  character: {\r\n    ship: 'Serenity',\r\n    name: 'Malcolm Reynolds',\r\n    value: 'reynolds'\r\n  }\r\n}\r\n```\r\n... rather than...\r\n\r\n```\r\n{\r\n  character: 'reynolds'\r\n}\r\n```\r\n\r\n... as it *should* be set to with `<option value=\"reynolds\">`"}}
{"actor":{"display_login":"kevlarr"}}