Update z-index when box looses selection