UI Toolkit events stop firing after script reload during Play Mode

Hello. I’ve encountered something that seems to be a bug. I haven’t found other topics on the subject.

Steps to reproduce:

  1. In a new project, create an empty GameObject.
  2. Add a UIDocument component to it.
  3. Create a UIDocument asset. Add a VisualElement and under it either a button, a checkbox or any input field as a child.
  4. Load UIDocument asset into the UIDocument component.
  5. Create a MonoBehaviour script.
  6. Enter PlayMode. The UI Toolkit widgets should be working.
  7. Modify the script, e.g. add a Debug.Log statement.
  8. After recompile and domain reload, try interacting with the UI. No events are being registered, no hover events or click events. I.e. the UI is completely unresponsive.

Unity version is 6000.0.27f1. This also happens in Unity 6.1 alpha. Doesn’t happen in Unity 2022.
Am I doing something wrong? Is it a bug?

OK. I got it fixed by adding the EventSystem object to the scene. Sorry if it is something obvious that I overlooked.

Weird that it is not required for the UI Toolkit events to work before the live script reload. Also, it was not required in the 2022 versions.