wyuenho/backgrid — pull request #177 by gbedardsice (2013-05-14 13:06:13+00:00)
Title: exitEditMode getting called twice on move command

When using move commands (tab, arrows, etc.), the `exitEditMode` method of the editor is being called twice. You can see the error [here](http://jsfiddle.net/p2n9P/3/) by simply using a move command.

The reason is, [here](https://github.com/wyuenho/backgrid/blob/master/src/body.js#L245), when you call `enterEditMode`, the `postRender` method of the new cell editor calls `focus` on the new editor element, which results in a `blur` event on the old editor. The `saveOrCancel` method is then called again on the old editor, and then triggers the `backgrid:edited` event a second time.

You can resolve this simply by moving [this](https://github.com/wyuenho/backgrid/blob/master/src/body.js#L270) line before the `if` block, to make sure that the old editor is actually removed before entering in the new editor.