TableView deleteRow() causing sizing issues

I have a tableView that inserts new rows based on the amount of text of an input to dynamically assign the proper height of the row, which works awesome. The only issue is when a user deletes a row it screws up the sizing of the row directly below it. Any ideas?

 for i = #row.params.Comments, 1, -1 do                                 local commentData = row.params.Comments[i]                                 local params = {                                     text = commentData.text,                                     timestamp = commentData.timestamp,                                     user = commentData.user,                                     userId = commentData.userId,                                     objectId = row.params.objectId,                                 }                                 local rowHeight = \_H\*.09                                 if string.len(commentData.text)/62 \> 1 then                                     for i=1, (string.len(commentData.text)/62) do                                         rowHeight = rowHeight + \_H\*.03                                     end                                 end                                 popuptableView:insertRow{                                     rowHeight = rowHeight,                                     rowColor = {1},                                     lineColor = { .9},                                     params = params                                 }                             end     --How I am deleting the row. It removes, but sizing gets thrown off   popuptableView:deleteRow(row.index)

Looks like it fixes it on re-rendering the rows after scrolling off the page and back on. I would rather not delete all rows and re-build due to this causing the user to see the top of the tableview. I could save the location as a variable and subtract one since the row they selected will be deleted, then have the scroll automatically scroll to this location, but it just doesn’t make sense.

Looks like it fixes it on re-rendering the rows after scrolling off the page and back on. I would rather not delete all rows and re-build due to this causing the user to see the top of the tableview. I could save the location as a variable and subtract one since the row they selected will be deleted, then have the scroll automatically scroll to this location, but it just doesn’t make sense.