diff --git a/config/schema/menu_block.schema.yml b/config/schema/menu_block.schema.yml
index ad08127..61eb902 100644
--- a/config/schema/menu_block.schema.yml
+++ b/config/schema/menu_block.schema.yml
@@ -11,6 +11,9 @@ block.settings.menu_block:*:
     expanded:
       type: boolean
       label: 'Expand all menu links'
+    expand_only_active_trails:
+      type: boolean
+      label: 'Expand only active trails'
     parent:
       type: string
       label: 'Parent menu link'
diff --git a/src/Plugin/Block/MenuBlock.php b/src/Plugin/Block/MenuBlock.php
index fab522a..8f29c42 100644
--- a/src/Plugin/Block/MenuBlock.php
+++ b/src/Plugin/Block/MenuBlock.php
@@ -40,6 +40,17 @@ class MenuBlock extends SystemMenuBlock {
       '#default_value' => $config['expand'],
       '#description' => $this->t('All menu links that have children will "Show as expanded".'),
     ];
+    $form['advanced']['expand_only_active_trails'] = [
+      '#type' => 'checkbox',
+      '#title' => $this->t('<strong>Expand only active tree</strong>'),
+      '#default_value' => $config['expand_only_active_trails'],
+      '#description' => $this->t('All menu links that are in active trails will "Show as expanded".'),
+      '#states' => [
+        'visible' => [
+          ':input[name="settings[expand]"]' => ['checked' => TRUE],
+        ]
+      ]
+    ];
 
     $menu_name = $this->getDerivativeId();
     $menus = Menu::loadMultiple(array($menu_name));
@@ -101,6 +112,7 @@ class MenuBlock extends SystemMenuBlock {
     $this->configuration['level'] = $form_state->getValue('level');
     $this->configuration['depth'] = $form_state->getValue('depth');
     $this->configuration['expand'] = $form_state->getValue('expand');
+    $this->configuration['expand_only_active_trails'] = $form_state->getValue('expand_only_active_trails');
     $this->configuration['parent'] = $form_state->getValue('parent');
     $this->configuration['suggestion'] = $form_state->getValue('suggestion');
   }
@@ -116,6 +128,7 @@ class MenuBlock extends SystemMenuBlock {
     $level = $this->configuration['level'];
     $depth = $this->configuration['depth'];
     $expand = $this->configuration['expand'];
+    $expand_only_active_trails = $this->configuration['expand_only_active_trails'];
     $parent = $this->configuration['parent'];
     $suggestion = $this->configuration['suggestion'];
 
@@ -128,7 +141,7 @@ class MenuBlock extends SystemMenuBlock {
       $parameters->setMaxDepth(min($level + $depth - 1, $this->menuTree->maxDepth()));
     }
     // If expandedParents is empty, the whole menu tree is built.
-    if ($expand) {
+    if ($expand && !$expand_only_active_trails) {
       $parameters->expandedParents = array();
     }
     // When a fixed parent item is set, root the menu tree at the given ID.
@@ -183,6 +196,7 @@ class MenuBlock extends SystemMenuBlock {
       'level' => 1,
       'depth' => 0,
       'expand' => 0,
+      'expand_only_active_trails' => 0,
       'parent' => $this->getDerivativeId() . ':',
       'suggestion' => strtr($this->getDerivativeId(), '-', '_'),
     ];
