TemplateContainer with absolute position is moved around by Justify Content setting of the parent

Hello. Why TemplateContainer with absolute position is moved around by its parent’s Justify Content setting if it’s set to Space Around or Space Evenly? Tested in 6000.0.26f1

How to reproduce:

  1. Create a UI Document for TemplateContainer

  2. Create a TemplateContainer from VisualTreeAsset, something like this:

_templateContainer = _asset.Instantiate();
_templateContainer.style.position = Position.Absolute;
_templateContainer.style.width = new StyleLength(new Length(100, LengthUnit.Percent));
_templateContainer.style.height = new StyleLength(new Length(100, LengthUnit.Percent));
_templateContainer.style.display = DisplayStyle.None;
  1. Create UIDocument with VisualElement inside. Set that visual element to Justify Content - Space Around. Add two buttons inside (just for visual):

  2. Add our _templateContainer to the VisualElement (I do this at runtime):

_uiParent = _ourUIDocument.rootVisualElement.Q<VisualElement>("TopVisual");
_uiParent.Add(_templateContainer);
_templateContainer.style.display = DisplayStyle.Flex;
  1. _templateContainer position is equal to the first button position (affected by Justify Content of the VisualElement):

If you turn off some buttons from the UI Toolkit Debugger, it will also move the Template Container to the next available button. At runtime. So, as a result, the element with absolute position is moved around by its parent’s settings and by other children of its parent hierarchy.

Is this intentional (and kind of weird) or is it a bug?