{% extends "forms/field.html.twig" %}

{% block field %}
  {% embed 'forms/default/fields.html.twig' with {name: field.name, fields: field.fields} %}
    {% set initial_state = field.name == parent_value ? '' : 'display: none;' %}
    {% block outer_markup_field_open %}
      <div id="{{ parent_name ~ '__' ~ field.name }}" class="form-element" style="{{ initial_state }}">
    {% endblock %}

    {% block outer_markup_field_close %}
        </div>
    {% endblock %}
  {% endembed %}
{% endblock %}

{% extends "forms/field.html.twig" %}

{% block field %}
  {% embed 'forms/default/fields.html.twig' with {name: field.name, fields: field.fields} %}
    {% set initial_state = field.name|string is not same as (parent_value|string) ? 'display: none;' %}
    {% block outer_markup_field_open %}
      <div id="{{ parent_name ~ '__' ~ field.name|string }}" class="form-element" style="{{ initial_state }}">
    {% endblock %}

    {% block outer_markup_field_close %}
        </div>
    {% endblock %}
  {% endembed %}
{% endblock %}

Make elements field options to work with int and bool values
Make elements field options to work with int and bool values
