Datatable: Delete row after Add isn't selecting correct row

I’ve created a code snippet here: snippet

I can add and edit rows successfully, and delete rows if I’ve not yet added one.

However, if I add a new row, then immediately click the trash can (delete) on that empty row, it deletes the one below instead. If I click out of the new row and back into it, though, then it deletes successfully.

What do I need to do to get the delete function to reliably pick the correct row after adding a new row and then opting to immediately delete it?

Thanks!

Hello, @EricBLivingston
It seems you need to first close the editor in a newly added row before removing it.
Check the snippet: Code Snippet

That did it!

Thank you very much!

Eric