I have a customelement WebDesktop
that can create another customelement AppWindow
.
If I create several AppWindow
I would like the one I clicked the last to be "focused" when it's created but also that if I click on an already created one it should be focused above the others , it should have a higher z-index.
Is there any way to do this? I don't understand how each already created AppWindow
can see how many new elements has been created since it was intially created.
My solution would be to put the zIndex to the amount of current amount of created AppWindow
Can each instanced customelement somehow find out how many new elements has been created or something like that? And also keep track if they have been removed?