Selectable gets triggered when scrolling in Panel

Hey Guys,

I just switched from adding an EventTrigger on instantiating objects on runtime to the method variant by adding the handler to the prefab. It is working fine for the scrolling issue I had before and now I can scroll while clicking on the selectable panels. The issue I now have is that this also triggers the selectables.

And at this point I have no idea what the difference is between select/deselect and PointerClick/PointerExit.
It was that behaviour i wanted to prevent and I am getting the same results. How can I prevent a deselection when scrolling or even clicking somewhere else?

Unfortunately Unitys documentation on UI elements is still very poor after all these years…

Thanks is advance

Going through this myself lately, and the only method I found to make a selectable “sticky” was to constantly poll EventSystem.current.currentSelectedGameObject and set it back with SetSelectedGameObject() if it changes outside my UI management system. For me, it was breaking keyboard / controller navigation if the player clicked with the mouse on the background. I’ll eventually look into writing my own input module to prevent it but it’s good enough for now.

Yeah, I read a lot issues where people started to write their own code. I was working on another issue right now and will let you know if I find another “cleaner” solution. I first have to study what the heck is the difference between all the states and what was Unitys idea to implement this kind. I believe there is a simpler option since this issue is not new. Like ignoring the background by giving it another tag or something.

Maybe meanwhile someone has another idea…

FYI:

I switched from selecteble component to Toggle component and put it in a ToggleGroup. I got rid of the option to colorize the background of my panel when selected, because Toggle is working similar to selectable - or even selectable is part of the Toggle. My only indicator is now the checkbox which is fair enough. But the question is still open for discussion, if someone has a decent solution for that, which I doubt.