Timing problem on table selection

I have a table with an additional column containing a button.
The button has a parameter which binds to a column in props.selection.data.

This usually works. But if a user selects row A, and then clicks on the button on row B, the selection data gets passed to the button before the selection data has changed.
ie, button gets row A data

Does anyone know if there is a wait command I could use to ensure selection data has changed? Or any other workaround for this problem.

Does it behave correctly when you wait for a certain period of time? My intuition (which may be flawed) is telling me it isn’t a timing issue

I haven’t managed to find expression to put in binding to make it wait.

It works perfectly if user first clicks on row and then the button on same row.

Just to confirm, you have the enableRowSelection set to True and enableColumnSelection set to False? When you click the button in row B, does it select the entire row, but your selection data object just doesn’t change?

When row is clicked, the selection data does change. Just not as fast as the button event.
So button still uses old selection data.

And yes, enableRowSelection is set to True and enableColumnSelection is set to False.