I've got a template like this:
{% if content %}
<div{{ attributes.addClass(classes) }}>
<div class="layout-region layout-region--main col-sm-8">
{{ content.main }}
</div>
{% if content.sidebar %}
<div class="layout-region layout-region--sidebar col-sm-4">
{{ content.sidebar }}
</div>
{% endif %}
</div>
{% endif %}
(I have also tried {% if content.sidebar|trim|length > 0 %}
with no change.)
A content type using this layout puts a single, optional field into the sidebar region. If that field is empty, I would expect content.sidebar to be empty, so that the sidebar div won't be output and the main div can expand to fill the space. However, instead I get an empty sidebar div.
Is this the expected behavior?