An example would be a repeating table with each row containing a dropdown and a textbox. There are 6 rows in the table.
I have a button that adds a row to the table using the code above.
If I select a dropdown in row 3 so that it's background turns blue and then try to add another row the new row will get added after row 3, which had the dropdown selected.
If I don't select any row that the new row gets added to the bottom as expected.
It just seams that the [last()] method does not work if a row is selected.