Hey! I am running into issues when configuring a UCommonButtonBase widget subclass to have Appearance Padding set to nonzero and visibility set to Visible. See Steps to Reproduce for details.
I would expect repro’ing the steps above would result in neither the OnHovered or OnClicked events from firing. The desired functionality here would be needing to hover or click the button (not the padding) to fire these events. There are some easy workarounds here like either not using Appearance Padding or setting the button to Not Hit-Testable (Self Only) instead of Visible. However I was wondering if there is a better universal fix to apply here that doesn’t require other devs to be aware of this issue to avoid it.
I’m guessing the issue here is due to the nature of the widget’s slate (MyWidget) taking up the space of the widget plus the padding, while the widget’s internal button’s slate (RootButton->MyCommonButton) takes up the space of just the widget (not the padding). Since the OnHovered/OnClicked events are bound to the widget and not the internal button, they trigger on the Appearance Padding. Additionally, since UCommonButtonBase overrides IsHovered to check the internal button’s state instead of the widget’s state, IsHovered is able to return false during the OnHovered callback when hovering the Appearance Padding.
Let me know if this behavior is intended or if you have any suggestions, thanks!