Button is interactable when activeInHierachy is false

Hey guys,

I had a hunt around in here and I couldn’t see that anyone had mentioned this, however a quick bug: if a button is nested within a hierarchy that is disabled at a higher level within the heirarchy (so for example, the button.parent.parent.active = false) the button still does two things:

  • click events still seem to be handled. So any events assigned to the buttons click handler will be triggered
  • when the mouse is over the invisible button, it blocks interaction

To replicate:

  • create a canvas
  • inside canvas create a widget
  • inside widget create a button
  • set the widget.active to false (ether in code or via inspector)
  • button will still handle click events and block interaction