I wanna create a drag scroll bar. so I add a scrollbar, and register MouseUpEvent, MouseDownEvent, MouseMoveEvent to this scrollbar in its construction function, that copied from here [Preformatted text](https://discussions.unity.com/t/scrollview-with-drag-scrolling/861606/21)
The matter is that I add Button to this scroll, and when I click it ,it wouldn’t react to click.
I tried to delete StopPropagation, so that event can get to the button, but it did not help.
Here is how I create the Button, and when I click, it never log the message.
By the way,the MouseDownEvent can work normally,while MouseUpEvent and its own button clicked event cannot work
for (var i = 0; i < 15; ++i)
{
var bt = new Button((() =>
{
Debug.Log("Click Up");
}))
{
name = "Bt" + i,
text = "Bt" + i,
style =
{
left=5,
width = 40,
height = 40,
backgroundColor = (Color)new Color32(56, 56, 56, 255)
}
};
//Only useTrickleDown.TrickleDown, can get this event during trickledown
bt.RegisterCallback<MouseDownEvent>(m_MenuScroll.ExternMouseDown,TrickleDown.TrickleDown);
bt.RegisterCallback<MouseUpEvent>(m_MenuScroll.ExternMouseUp,TrickleDown.TrickleDown);
m_MenuScroll.Add(bt);
}
MouseEvents are backward-compatibility events that are superseded by PointerEvents, try using PointerUpEvent instead