I’ve created a custom dropdown box in the UI system. I have a problem that when the dropdown list appears, it is sorted behind other elements in the Canvas due to it’s position in the hierarchy…

You can see the ‘Patient Details Panel’ is layered on top of the ‘Vision Test’ dropdown…

I always want the dropdown to appear on top of other elements so I tried adding a canvas component to the dropdown and clicking ‘override sorting layer’ to position it on top. Now, although the dropdown appears on top, I can’t interact with it. I tried adding an Event System to the dropdown component too but then I can’t even activate the dropdown.
Has anyone encountered the same problem or can suggest a solution? I can’t use a newer version of Unity and I’ve already tried using a 3rd party dropdown but it’s causing Unity to crash. I’m stuck with writing my own like this.
This wasn't possible for me. You can also add a canvas component to an object in your ui and set it to override sorting while assigning a higher sorting layer. That component will then appear 'above' other UI elements regardless of their position in the hierarchy.
– xiak