{"action":"created","comment":{"url":"https://api.github.com/repos/vmware/clarity/pulls/comments/147239636","pull_request_review_id":72034460,"id":147239636,"diff_hunk":"@@ -114,6 +114,33 @@ export default function(): void {\n             expect(selectionInstance.isSelected(4)).toBe(false);\n         });\n \n+        it(\"handles clrDgItems trackBy index expressions in multi selection type\", function() {\n+            // IMPORTANT, using clrDgItems with trackBy will use trackBy reference in multi\n+            selectionInstance.selectionType = SelectionType.Multi;\n+            itemsInstance.trackBy = (index, item) => index;\n+            // Must set the trackBy before setting the items\n+            itemsInstance.all = [\"a\", \"b\", \"c\", \"d\", \"e\"];\n+            selectionInstance.current = [1, 3];","path":"src/clarity-angular/data/datagrid/providers/selection.spec.ts","position":10,"original_position":10,"commit_id":"96e1c9a7a9e701df97d7b2f3e1a6849c872b115d","original_commit_id":"96e1c9a7a9e701df97d7b2f3e1a6849c872b115d","user":{"login":"youdz","id":4647197,"avatar_url":"https://avatars3.githubusercontent.com/u/4647197?v=4","gravatar_id":"","url":"https://api.github.com/users/youdz","html_url":"https://github.com/youdz","followers_url":"https://api.github.com/users/youdz/followers","following_url":"https://api.github.com/users/youdz/following{/other_user}","gists_url":"https://api.github.com/users/youdz/gists{/gist_id}","starred_url":"https://api.github.com/users/youdz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/youdz/subscriptions","organizations_url":"https://api.github.com/users/youdz/orgs","repos_url":"https://api.github.com/users/youdz/repos","events_url":"https://api.github.com/users/youdz/events{/privacy}","received_events_url":"https://api.github.com/users/youdz/received_events","type":"User","site_admin":false},"body":"Yeah, that's what I feared. By changing the meaning of `current`, you break the behavior of our two-way binding on our current selection. People want to select the items, not their trackBys.","created_at":"2017-10-26T19:12:40Z","updated_at":"2017-10-26T19:13:03Z","html_url":"https://github.com/vmware/clarity/pull/1500#discussion_r147239636","pull_request_url":"https://api.github.com/repos/vmware/clarity/pulls/1500","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/vmware/clarity/pulls/comments/147239636"},"html":{"href":"https://github.com/vmware/clarity/pull/1500#discussion_r147239636"},"pull_request":{"href":"https://api.github.com/repos/vmware/clarity/pulls/1500"}}},"pull_request":{"url":"https://api.github.com/repos/vmware/clarity/pulls/1500","id":142631636,"html_url":"https://github.com/vmware/clarity/pull/1500","diff_url":"https://github.com/vmware/clarity/pull/1500.diff","patch_url":"https://github.com/vmware/clarity/pull/1500.patch","issue_url":"https://api.github.com/repos/vmware/clarity/issues/1500","number":1500,"state":"open","locked":false,"title":"[NG] fix bug with selection with pagination and server-driven datagrids","user":{"login":"gnomeontherun","id":79500,"avatar_url":"https://avatars3.githubusercontent.com/u/79500?v=4","gravatar_id":"","url":"https://api.github.com/users/gnomeontherun","html_url":"https://github.com/gnomeontherun","followers_url":"https://api.github.com/users/gnomeontherun/followers","following_url":"https://api.github.com/users/gnomeontherun/following{/other_user}","gists_url":"https://api.github.com/users/gnomeontherun/gists{/gist_id}","starred_url":"https://api.github.com/users/gnomeontherun/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gnomeontherun/subscriptions","organizations_url":"https://api.github.com/users/gnomeontherun/orgs","repos_url":"https://api.github.com/users/gnomeontherun/repos","events_url":"https://api.github.com/users/gnomeontherun/events{/privacy}","received_events_url":"https://api.github.com/users/gnomeontherun/received_events","type":"User","site_admin":false},"body":"Since you cannot use clrDgItems with server-driven datagrids, we need to ensure the trackBy function is leveraged as part of the comparison process for determining if something is equal or not. This is due to server-driven datagrids getting new objects with each page (from an API for example), and those don't strictly equal one another. You must use trackBy for selection to display correctly, though selection does persist without it.\r\n\r\ncloses #1393","created_at":"2017-09-22T17:34:43Z","updated_at":"2017-10-26T19:13:03Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d1aa5363826272d9c2d79a4bf99a484123cebd74","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/vmware/clarity/pulls/1500/commits","review_comments_url":"https://api.github.com/repos/vmware/clarity/pulls/1500/comments","review_comment_url":"https://api.github.com/repos/vmware/clarity/pulls/comments{/number}","comments_url":"https://api.github.com/repos/vmware/clarity/issues/1500/comments","statuses_url":"https://api.github.com/repos/vmware/clarity/statuses/96e1c9a7a9e701df97d7b2f3e1a6849c872b115d","head":{"label":"gnomeontherun:dg-server-pagination-1393","ref":"dg-server-pagination-1393","sha":"96e1c9a7a9e701df97d7b2f3e1a6849c872b115d","user":{"login":"gnomeontherun","id":79500,"avatar_url":"https://avatars3.githubusercontent.com/u/79500?v=4","gravatar_id":"","url":"https://api.github.com/users/gnomeontherun","html_url":"https://github.com/gnomeontherun","followers_url":"https://api.github.com/users/gnomeontherun/followers","following_url":"https://api.github.com/users/gnomeontherun/following{/other_user}","gists_url":"https://api.github.com/users/gnomeontherun/gists{/gist_id}","starred_url":"https://api.github.com/users/gnomeontherun/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gnomeontherun/subscriptions","organizations_url":"https://api.github.com/users/gnomeontherun/orgs","repos_url":"https://api.github.com/users/gnomeontherun/repos","events_url":"https://api.github.com/users/gnomeontherun/events{/privacy}","received_events_url":"https://api.github.com/users/gnomeontherun/received_events","type":"User","site_admin":false},"repo":{"id":74230390,"name":"clarity","full_name":"gnomeontherun/clarity","owner":{"login":"gnomeontherun","id":79500,"avatar_url":"https://avatars3.githubusercontent.com/u/79500?v=4","gravatar_id":"","url":"https://api.github.com/users/gnomeontherun","html_url":"https://github.com/gnomeontherun","followers_url":"https://api.github.com/users/gnomeontherun/followers","following_url":"https://api.github.com/users/gnomeontherun/following{/other_user}","gists_url":"https://api.github.com/users/gnomeontherun/gists{/gist_id}","starred_url":"https://api.github.com/users/gnomeontherun/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gnomeontherun/subscriptions","organizations_url":"https://api.github.com/users/gnomeontherun/orgs","repos_url":"https://api.github.com/users/gnomeontherun/repos","events_url":"https://api.github.com/users/gnomeontherun/events{/privacy}","received_events_url":"https://api.github.com/users/gnomeontherun/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/gnomeontherun/clarity","description":"Clarity Design System: UX guidelines, HTML/CSS framework, and Angular 2 components working together to craft exceptional experiences","fork":true,"url":"https://api.github.com/repos/gnomeontherun/clarity","forks_url":"https://api.github.com/repos/gnomeontherun/clarity/forks","keys_url":"https://api.github.com/repos/gnomeontherun/clarity/keys{/key_id}","collaborators_url":"https://api.github.com/repos/gnomeontherun/clarity/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/gnomeontherun/clarity/teams","hooks_url":"https://api.github.com/repos/gnomeontherun/clarity/hooks","issue_events_url":"https://api.github.com/repos/gnomeontherun/clarity/issues/events{/number}","events_url":"https://api.github.com/repos/gnomeontherun/clarity/events","assignees_url":"https://api.github.com/repos/gnomeontherun/clarity/assignees{/user}","branches_url":"https://api.github.com/repos/gnomeontherun/clarity/branches{/branch}","tags_url":"https://api.github.com/repos/gnomeontherun/clarity/tags","blobs_url":"https://api.github.com/repos/gnomeontherun/clarity/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/gnomeontherun/clarity/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/gnomeontherun/clarity/git/refs{/sha}","trees_url":"https://api.github.com/repos/gnomeontherun/clarity/git/trees{/sha}","statuses_url":"https://api.github.com/repos/gnomeontherun/clarity/statuses/{sha}","languages_url":"https://api.github.com/repos/gnomeontherun/clarity/languages","stargazers_url":"https://api.github.com/repos/gnomeontherun/clarity/stargazers","contributors_url":"https://api.github.com/repos/gnomeontherun/clarity/contributors","subscribers_url":"https://api.github.com/repos/gnomeontherun/clarity/subscribers","subscription_url":"https://api.github.com/repos/gnomeontherun/clarity/subscription","commits_url":"https://api.github.com/repos/gnomeontherun/clarity/commits{/sha}","git_commits_url":"https://api.github.com/repos/gnomeontherun/clarity/git/commits{/sha}","comments_url":"https://api.github.com/repos/gnomeontherun/clarity/comments{/number}","issue_comment_url":"https://api.github.com/repos/gnomeontherun/clarity/issues/comments{/number}","contents_url":"https://api.github.com/repos/gnomeontherun/clarity/contents/{+path}","compare_url":"https://api.github.com/repos/gnomeontherun/clarity/compare/{base}...{head}","merges_url":"https://api.github.com/repos/gnomeontherun/clarity/merges","archive_url":"https://api.github.com/repos/gnomeontherun/clarity/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/gnomeontherun/clarity/downloads","issues_url":"https://api.github.com/repos/gnomeontherun/clarity/issues{/number}","pulls_url":"https://api.github.com/repos/gnomeontherun/clarity/pulls{/number}","milestones_url":"https://api.github.com/repos/gnomeontherun/clarity/milestones{/number}","notifications_url":"https://api.github.com/repos/gnomeontherun/clarity/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/gnomeontherun/clarity/labels{/name}","releases_url":"https://api.github.com/repos/gnomeontherun/clarity/releases{/id}","deployments_url":"https://api.github.com/repos/gnomeontherun/clarity/deployments","created_at":"2016-11-19T19:27:08Z","updated_at":"2016-11-19T19:27:10Z","pushed_at":"2017-10-24T21:30:46Z","git_url":"git://github.com/gnomeontherun/clarity.git","ssh_url":"git@github.com:gnomeontherun/clarity.git","clone_url":"https://github.com/gnomeontherun/clarity.git","svn_url":"https://github.com/gnomeontherun/clarity","homepage":"https://vmware.github.io/clarity/","size":113567,"stargazers_count":0,"watchers_count":0,"language":"TypeScript","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"vmware:master","ref":"master","sha":"601e0219de901635106d01e0645cd35ed6e2add3","user":{"login":"vmware","id":473334,"avatar_url":"https://avatars0.githubusercontent.com/u/473334?v=4","gravatar_id":"","url":"https://api.github.com/users/vmware","html_url":"https://github.com/vmware","followers_url":"https://api.github.com/users/vmware/followers","following_url":"https://api.github.com/users/vmware/following{/other_user}","gists_url":"https://api.github.com/users/vmware/gists{/gist_id}","starred_url":"https://api.github.com/users/vmware/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vmware/subscriptions","organizations_url":"https://api.github.com/users/vmware/orgs","repos_url":"https://api.github.com/users/vmware/repos","events_url":"https://api.github.com/users/vmware/events{/privacy}","received_events_url":"https://api.github.com/users/vmware/received_events","type":"Organization","site_admin":false},"repo":{"id":69590701,"name":"clarity","full_name":"vmware/clarity","owner":{"login":"vmware","id":473334,"avatar_url":"https://avatars0.githubusercontent.com/u/473334?v=4","gravatar_id":"","url":"https://api.github.com/users/vmware","html_url":"https://github.com/vmware","followers_url":"https://api.github.com/users/vmware/followers","following_url":"https://api.github.com/users/vmware/following{/other_user}","gists_url":"https://api.github.com/users/vmware/gists{/gist_id}","starred_url":"https://api.github.com/users/vmware/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vmware/subscriptions","organizations_url":"https://api.github.com/users/vmware/orgs","repos_url":"https://api.github.com/users/vmware/repos","events_url":"https://api.github.com/users/vmware/events{/privacy}","received_events_url":"https://api.github.com/users/vmware/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/vmware/clarity","description":"UX guidelines, HTML/CSS framework, and Angular components working together to craft exceptional experiences","fork":false,"url":"https://api.github.com/repos/vmware/clarity","forks_url":"https://api.github.com/repos/vmware/clarity/forks","keys_url":"https://api.github.com/repos/vmware/clarity/keys{/key_id}","collaborators_url":"https://api.github.com/repos/vmware/clarity/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/vmware/clarity/teams","hooks_url":"https://api.github.com/repos/vmware/clarity/hooks","issue_events_url":"https://api.github.com/repos/vmware/clarity/issues/events{/number}","events_url":"https://api.github.com/repos/vmware/clarity/events","assignees_url":"https://api.github.com/repos/vmware/clarity/assignees{/user}","branches_url":"https://api.github.com/repos/vmware/clarity/branches{/branch}","tags_url":"https://api.github.com/repos/vmware/clarity/tags","blobs_url":"https://api.github.com/repos/vmware/clarity/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/vmware/clarity/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/vmware/clarity/git/refs{/sha}","trees_url":"https://api.github.com/repos/vmware/clarity/git/trees{/sha}","statuses_url":"https://api.github.com/repos/vmware/clarity/statuses/{sha}","languages_url":"https://api.github.com/repos/vmware/clarity/languages","stargazers_url":"https://api.github.com/repos/vmware/clarity/stargazers","contributors_url":"https://api.github.com/repos/vmware/clarity/contributors","subscribers_url":"https://api.github.com/repos/vmware/clarity/subscribers","subscription_url":"https://api.github.com/repos/vmware/clarity/subscription","commits_url":"https://api.github.com/repos/vmware/clarity/commits{/sha}","git_commits_url":"https://api.github.com/repos/vmware/clarity/git/commits{/sha}","comments_url":"https://api.github.com/repos/vmware/clarity/comments{/number}","issue_comment_url":"https://api.github.com/repos/vmware/clarity/issues/comments{/number}","contents_url":"https://api.github.com/repos/vmware/clarity/contents/{+path}","compare_url":"https://api.github.com/repos/vmware/clarity/compare/{base}...{head}","merges_url":"https://api.github.com/repos/vmware/clarity/merges","archive_url":"https://api.github.com/repos/vmware/clarity/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/vmware/clarity/downloads","issues_url":"https://api.github.com/repos/vmware/clarity/issues{/number}","pulls_url":"https://api.github.com/repos/vmware/clarity/pulls{/number}","milestones_url":"https://api.github.com/repos/vmware/clarity/milestones{/number}","notifications_url":"https://api.github.com/repos/vmware/clarity/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/vmware/clarity/labels{/name}","releases_url":"https://api.github.com/repos/vmware/clarity/releases{/id}","deployments_url":"https://api.github.com/repos/vmware/clarity/deployments","created_at":"2016-09-29T17:24:17Z","updated_at":"2017-10-26T18:15:50Z","pushed_at":"2017-10-26T17:57:26Z","git_url":"git://github.com/vmware/clarity.git","ssh_url":"git@github.com:vmware/clarity.git","clone_url":"https://github.com/vmware/clarity.git","svn_url":"https://github.com/vmware/clarity","homepage":"http://clarity.design","size":172986,"stargazers_count":2535,"watchers_count":2535,"language":"TypeScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":238,"mirror_url":null,"archived":false,"open_issues_count":231,"forks":238,"open_issues":231,"watchers":2535,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/vmware/clarity/pulls/1500"},"html":{"href":"https://github.com/vmware/clarity/pull/1500"},"issue":{"href":"https://api.github.com/repos/vmware/clarity/issues/1500"},"comments":{"href":"https://api.github.com/repos/vmware/clarity/issues/1500/comments"},"review_comments":{"href":"https://api.github.com/repos/vmware/clarity/pulls/1500/comments"},"review_comment":{"href":"https://api.github.com/repos/vmware/clarity/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/vmware/clarity/pulls/1500/commits"},"statuses":{"href":"https://api.github.com/repos/vmware/clarity/statuses/96e1c9a7a9e701df97d7b2f3e1a6849c872b115d"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"youdz"}}