Table selectedDataIndex key not updating

  • Goal: I have a button that adds a new row and selects it to more easily flow for the user. My current issue is it recently stopped working and the selected row keeps glitching out and selecting incorrect rows, such as going back up to first row.

  • Steps: I have tried different await and checking my state setting to see if it was my states causing an issues. I have tried commenting out different sections code and after a while realized the table state 'selectedDataIndex' was not updating at times. And this seems to be causing the issue when i then call for selecting the next row

await edit_part.trigger()
await add_part.trigger()
await table3.selectNextRow()

It looks like there was a similar issue here in this thread