{"action":"created","issue":{"url":"https://api.github.com/repos/angular-ui/ng-grid/issues/2844","labels_url":"https://api.github.com/repos/angular-ui/ng-grid/issues/2844/labels{/name}","comments_url":"https://api.github.com/repos/angular-ui/ng-grid/issues/2844/comments","events_url":"https://api.github.com/repos/angular-ui/ng-grid/issues/2844/events","html_url":"https://github.com/angular-ui/ng-grid/issues/2844","id":58936692,"number":2844,"title":"gridApi.edit.on.afterCellEdit fires a second time after initial row edit.","user":{"login":"ddelapaz","id":10531886,"avatar_url":"https://avatars.githubusercontent.com/u/10531886?v=3","gravatar_id":"","url":"https://api.github.com/users/ddelapaz","html_url":"https://github.com/ddelapaz","followers_url":"https://api.github.com/users/ddelapaz/followers","following_url":"https://api.github.com/users/ddelapaz/following{/other_user}","gists_url":"https://api.github.com/users/ddelapaz/gists{/gist_id}","starred_url":"https://api.github.com/users/ddelapaz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ddelapaz/subscriptions","organizations_url":"https://api.github.com/users/ddelapaz/orgs","repos_url":"https://api.github.com/users/ddelapaz/repos","events_url":"https://api.github.com/users/ddelapaz/events{/privacy}","received_events_url":"https://api.github.com/users/ddelapaz/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-02-25T17:14:55Z","updated_at":"2015-02-25T17:48:41Z","closed_at":null,"body":"After the first row edit, if i wait nothing happens (as it should) if i click on the grid then scroll down (scroll wheel up) in OSX, then the `afterCellEdit` fires.\r\n\r\n**First Edit - I'm editing Name on first Row (from `Alex` to `Dayan`)** \r\n\r\n![screenshot 2015-02-25 11 59 45](https://cloud.githubusercontent.com/assets/10531886/6375803/86c459d0-bce7-11e4-94d7-5adae5cc32ec.png)\r\n\r\n\r\n**All should be done but if I scroll down, it fires again.**\r\n\r\n![screenshot 2015-02-25 12 01 00](https://cloud.githubusercontent.com/assets/10531886/6375811/92f91808-bce7-11e4-99b0-3ea7ee3fa39e.png)\r\n"},"comment":{"url":"https://api.github.com/repos/angular-ui/ng-grid/issues/comments/76016102","html_url":"https://github.com/angular-ui/ng-grid/issues/2844#issuecomment-76016102","issue_url":"https://api.github.com/repos/angular-ui/ng-grid/issues/2844","id":76016102,"user":{"login":"PaulL1","id":5248789,"avatar_url":"https://avatars.githubusercontent.com/u/5248789?v=3","gravatar_id":"","url":"https://api.github.com/users/PaulL1","html_url":"https://github.com/PaulL1","followers_url":"https://api.github.com/users/PaulL1/followers","following_url":"https://api.github.com/users/PaulL1/following{/other_user}","gists_url":"https://api.github.com/users/PaulL1/gists{/gist_id}","starred_url":"https://api.github.com/users/PaulL1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PaulL1/subscriptions","organizations_url":"https://api.github.com/users/PaulL1/orgs","repos_url":"https://api.github.com/users/PaulL1/repos","events_url":"https://api.github.com/users/PaulL1/events{/privacy}","received_events_url":"https://api.github.com/users/PaulL1/received_events","type":"User","site_admin":false},"created_at":"2015-02-25T17:48:41Z","updated_at":"2015-02-25T17:48:41Z","body":"Most likely what is happening is that you have a particular cell focused, you scroll down, which triggers a lose focus (endCellEdit) on that cell.  It also selects another cell, which if you have edit on focus, will start  editing that cell.  When you scroll again, it loses focus on the second cell, and selects another cell.\r\n\r\nThe `if (newValue !== oldValue) {` check should avoid any logic running in this situation, so it shouldn't break anything.\r\n\r\nThe best fix for this would be for us to discard the focused cell upon scroll (and not select another cell).  Unfortunately we haven't been successful in doing this without having bad side effects in the code - we got problems when you selected a cell and then a scroll was triggered (perhaps by the cell being partly off the page, and then typing into it, although there were other scenarios).\r\n\r\nWhat problem does this cause for you?"}}