Disable autofocus on loading frame

I have multiple turbo frames that each have their own form. When submitting the form, the frame gets reloaded and replaced with a new form. However the user already moved on to the next frame/form. However, when the new frame is rendered, it focuses automatically on the first input in what was just replaced, which interrupts user experience.

I believe this is the piece of code that is causing this behavior:

There is a boolean that is controlling the behavior, but I don’t know how to change it.

Is there a nice configurable way to disable autofocus on render?

Of course you’ll find the actual root cause of the problem mere moments after posting the issue on a message board :person_facepalming:

The multiple forms resulted in the same ID multiple times. As soon as I gave every input element a really unique ID, the problem went away.

Still; I don’t understand where the weird re-focus came from.