Why does 'Next Wrap' fail when the click event and target are on the same Dynamic Panel?

I set a ‘Click’ interaction on a dynamic panel with two states to ‘Set Panel State to Next’ with the ‘Wrap from last to first’ option, but it doesn’t transition from State 2 back to State 1. What could be the reason?
test.rp (48.4 KB)

caused by “Fit to Content” setting on the dynamic panel. I’m not sure why this happens, but it appears to be a bug.

That definitely sounds like a bug with the panel container. If disabling ‘Fit to Content’ doesn’t work, you might try manually setting the state to ‘1’ using a conditional case when the current state is the last one. It’s a bit more work but usually bypasses the wrap issues.

I’ve encountered similar behavior when the interaction is placed directly on the panel itself. It might be worth checking if there are any overlapping widgets or if the click event registers more reliably when assigned to a hot-spot inside the state rather than the panel container.