This question was created in reference to: [Mouse position not registering correctly for widget switchers in retainer [Content removed]
It seems like using animated transitions on a CommonAnimatedSwitcher inside a retained-rendered RetainerBox breaks input somehow - with default transition settings, when the switcher changes index the newly displayed widget will not respond to mouse input. Turning off retained rendering or dropping the anim time to zero both fix the issue, but obviously come with a hit to visual quality.
Steps to Reproduce
Create a UMG user widget with the following structure and (non-default) settings:
- Root
- RetainerBox : RetainRender = true
- CommonAnimatedSwitcher
- [subwidget] CommonActivatableWidget
- [subwidget] CommonActivatableWidget
Add logic to forward the On Clicked events from the buttons in the subwidgets to the parent widget, and use them to switch the active index on the switcher.
Notice that when you run the above, the first click will switch from index 1 > 2 correctly, but then the button on the widget at index 2 will be inactive, not responding to clicks or hovers.
The issue seems to be an interaction between the retained render path on the retainer box and the animation on the CommonAnimatedSwitcher; if you turn off the “Retain Render” flag on the retainer or set the “Transition Duration” to 0 on the switcher, it’ll work fine.
In my example project, the top half of the widget is _not_ retained and cycles between magenta and cyan pages as expected. The bottom half _is_ retained and you can swap from red to blue, but the button on the blue page is non-responsive.
Hi,
We have a change at CL#40790289 that was checked in since your last ticket, a one-line change to clear the hit test grid in SRetainerWidget::PaintSlowPath. Could you give that a try and see if it solves things on your end? I had to revert it locally to reproduce the issue with your setup, so hopefully that should be all you need to fix hit testing.
Best,
Cody
Hi Cody,
Sorry, took a while to get a chance to test this, but yes, I can confirm that this fixes the issue!
Amazing stuff, thanks a lot (and glad it’s such a minor tweak!)