I am working with popup in react-map-gl, in the following documentation and regarding sortByDepth property, they mentioned that:
If true, the order of the popups will be dynamically rearranged to ensure that the ones anchored closer to the camera are rendered on top. Useful when showing multiple popups in a tilted map.
In my work I have many popups, I need to keep the popup which I clicked to be on the top, by making sortByDepth = false and returning the clicked popup as last element to be rendered between the popups I am able to do that, but still I need to keep the behavior of the other popups to be sorted by the depth, I tried to make a condition: if the current popup is not equal to the selected one, then sortByDepth equals to true, else it is false, but the behavior is not clear to me (it didn't work now the popup which I select will not be on the top but all the other popups will be above it).
so How does the rendering go if sortByDepth property differs from a one popup to another?