{"action":"created","issue":{"url":"https://api.github.com/repos/ocadotechnology/hexagonjs/issues/66","labels_url":"https://api.github.com/repos/ocadotechnology/hexagonjs/issues/66/labels{/name}","comments_url":"https://api.github.com/repos/ocadotechnology/hexagonjs/issues/66/comments","events_url":"https://api.github.com/repos/ocadotechnology/hexagonjs/issues/66/events","html_url":"https://github.com/ocadotechnology/hexagonjs/issues/66","id":123793063,"number":66,"title":"hx.DataTable::selectedRows returns [undefined] sometimes when rows have been deselected and only one row can be selected at once","user":{"login":"georgesimms","id":7927477,"avatar_url":"https://avatars.githubusercontent.com/u/7927477?v=3","gravatar_id":"","url":"https://api.github.com/users/georgesimms","html_url":"https://github.com/georgesimms","followers_url":"https://api.github.com/users/georgesimms/followers","following_url":"https://api.github.com/users/georgesimms/following{/other_user}","gists_url":"https://api.github.com/users/georgesimms/gists{/gist_id}","starred_url":"https://api.github.com/users/georgesimms/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/georgesimms/subscriptions","organizations_url":"https://api.github.com/users/georgesimms/orgs","repos_url":"https://api.github.com/users/georgesimms/repos","events_url":"https://api.github.com/users/georgesimms/events{/privacy}","received_events_url":"https://api.github.com/users/georgesimms/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-12-24T11:19:38Z","updated_at":"2015-12-24T11:20:39Z","closed_at":null,"body":"Consider the following\r\n\r\n    table.selectEnabled(true)\r\n    table.singleSelection(true)\r\n    table.selectedRows() // => []\r\n    table.selectedRows([0])\r\n    table.selectedRows() // => [0]\r\n    table.selectedRows([])\r\n    table.selectedRows() // => expected: [], actual: [undefined]\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/ocadotechnology/hexagonjs/issues/comments/167095242","html_url":"https://github.com/ocadotechnology/hexagonjs/issues/66#issuecomment-167095242","issue_url":"https://api.github.com/repos/ocadotechnology/hexagonjs/issues/66","id":167095242,"user":{"login":"georgesimms","id":7927477,"avatar_url":"https://avatars.githubusercontent.com/u/7927477?v=3","gravatar_id":"","url":"https://api.github.com/users/georgesimms","html_url":"https://github.com/georgesimms","followers_url":"https://api.github.com/users/georgesimms/followers","following_url":"https://api.github.com/users/georgesimms/following{/other_user}","gists_url":"https://api.github.com/users/georgesimms/gists{/gist_id}","starred_url":"https://api.github.com/users/georgesimms/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/georgesimms/subscriptions","organizations_url":"https://api.github.com/users/georgesimms/orgs","repos_url":"https://api.github.com/users/georgesimms/repos","events_url":"https://api.github.com/users/georgesimms/events{/privacy}","received_events_url":"https://api.github.com/users/georgesimms/received_events","type":"User","site_admin":false},"created_at":"2015-12-24T11:20:39Z","updated_at":"2015-12-24T11:20:39Z","body":"I think the relevant line is\r\n\r\n      if @singleSelection() and hx.isArray(value)\r\n        value = [value[0]]\r\n\r\nWhich should probably be\r\n\r\n      if @singleSelection() and hx.isArray(value) and value.length\r\n        value = [value[0]]\r\n\r\nBut it's worth doing some tests"}}