I have a toggle button that opens and closes a tray of 4 other toggles. The tray slides out via an animation when I click on the toggle. It works well but when i click on the space to the left to the toggle (where the mask is located) then toggle is also reacting to the click and the tray slides out.
Since the mask is still a graphic it will still accept input. The event system does not care if the image is transparent before sending events (since this is a large overhead to check when most things don’t care). What you could do is have your class use ICanvasRaycastFilter to choose when your graphic should be clickable.
public bool IsRaycastLocationValid (Vector2 sp, Camera eventCamera)
{
return [Your logic]
}