Undo bringLayerToFront: put a regular layer's zIndex back to the
value it was opened with and re-sort allLayers. The layer object is
replaced via spread — elements, regionFocus, hostPage and
crossPage references are kept, so element components do not remount and
no user state is lost.
No-op when the layer's zIndex already equals its initial value. Modal
layers are unaffected, mirroring bringLayerToFront.
Undo bringLayerToFront: put a regular layer's zIndex back to the value it was opened with and re-sort
allLayers. The layer object is replaced via spread —elements,regionFocus,hostPageandcrossPagereferences are kept, so element components do not remount and no user state is lost.No-op when the layer's zIndex already equals its initial value. Modal layers are unaffected, mirroring bringLayerToFront.