The button does not know its own index in another container. Either give the button an ID or, much better, dispatch the click with some data - so you don’t need to work with IDs / indexes. Posted this today, seems very relevant:
The button does not know its own index in another container. Either give the button an ID or, much better, dispatch the click with some data - so you don’t need to work with IDs / indexes. Posted this today, seems very relevant: