The solution that worked for me is for listening for the element upon receiving the focus, storing the previous elements locally and settings the accessibility label accordingly.
Below article helped with the solution - link
Listening for the focus change.
[