diff --git a/core/modules/views/src/Plugin/views/style/StylePluginBase.php b/core/modules/views/src/Plugin/views/style/StylePluginBase.php
index 7274abd..75c8bc7 100644
--- a/core/modules/views/src/Plugin/views/style/StylePluginBase.php
+++ b/core/modules/views/src/Plugin/views/style/StylePluginBase.php
@@ -684,7 +684,17 @@ protected function renderFields(array $result) {
             '#cache_properties' => $field_ids,
           ];
           $renderer->addCacheableDependency($data, $this->view->storage);
-          $renderer->renderPlain($data);
+          // Views may be rendered both inside and outside a render context:
+          // - HTML views are rendered inside a render context: then we want to
+          //   use ::render(), so that attachments and cacheability are bubbled.
+          // - non-HTML views are rendered outside a render context: then we
+          //   want to use ::renderPlain(), so that no bubbling happens
+          if ($renderer->hasRenderContext()) {
+            $renderer->render($data);
+          }
+          else {
+            $renderer->renderPlain($data);
+          }
 
           // Extract field output from the render array and post process it.
           $fields = $this->view->field;
diff --git a/core/modules/views/src/Tests/Handler/FieldDropButtonTest.php b/core/modules/views/src/Tests/Handler/FieldDropButtonTest.php
index 8cbb081..5de614b 100644
--- a/core/modules/views/src/Tests/Handler/FieldDropButtonTest.php
+++ b/core/modules/views/src/Tests/Handler/FieldDropButtonTest.php
@@ -32,6 +32,16 @@ class FieldDropButtonTest extends HandlerTestBase {
   public static $modules = array('node');
 
   /**
+   * {@inheritdoc}
+   */
+  public function setUp() {
+    parent::setUp();
+
+    $admin_user = $this->drupalCreateUser(['access content overview', 'administer nodes', 'bypass node access']);
+    $this->drupalLogin($admin_user);
+  }
+
+  /**
    * Tests dropbutton field.
    */
   public function testDropbutton() {
@@ -48,6 +58,14 @@ public function testDropbutton() {
       $result = $this->xpath('//ul[contains(@class, dropbutton)]/li/a[contains(@href, :path) and text()=:title]', array(':path' => '/node/' . $node->id(), ':title' => t('Custom Text')));
       $this->assertEqual(count($result), 1, 'Just one custom link was found.');
     }
+
+    // Check if the dropbutton.js library is available.
+    $this->drupalGet('admin/content');
+    $this->assertRaw('dropbutton.js');
+    // Check if the dropbutton.js library is available on a cached page to
+    // ensure that bubbleable metadata is not lost in the views render workflow.
+    $this->drupalGet('admin/content');
+    $this->assertRaw('dropbutton.js');
   }
 
 }
