diff --git a/core/modules/views_ui/admin.inc b/core/modules/views_ui/admin.inc
index 1187be5..d37c969 100644
--- a/core/modules/views_ui/admin.inc
+++ b/core/modules/views_ui/admin.inc
@@ -315,7 +315,7 @@ function views_ui_build_form_url(FormStateInterface $form_state) {
 function views_ui_form_button_was_clicked($element, FormStateInterface $form_state) {
   $user_input = $form_state->getUserInput();
   $process_input = empty($element['#disabled']) && ($form_state->isProgrammed() || ($form_state->isProcessingInput() && (!isset($element['#access']) || $element['#access'])));
-  if ($process_input && !$form_state->getTriggeringElement() && !empty($element['#is_button']) && isset($user_input[$element['#name']]) && isset($element['#values']) && in_array($user_input[$element['#name']], $element['#values'], TRUE)) {
+  if ($process_input && !$form_state->getTriggeringElement() && !empty($element['#is_button']) && isset($user_input[$element['#name']]) && isset($element['#values']) && in_array((string) $user_input[$element['#name']], $element['#values'])) {
     $form_state->setTriggeringElement($element);
   }
   return $element;
diff --git a/core/modules/views_ui/src/Tests/DisplayTest.php b/core/modules/views_ui/src/Tests/DisplayTest.php
index ff7ca81..53e3556 100644
--- a/core/modules/views_ui/src/Tests/DisplayTest.php
+++ b/core/modules/views_ui/src/Tests/DisplayTest.php
@@ -35,6 +35,42 @@ class DisplayTest extends UITestBase {
   public static $modules = array('contextual');
 
   /**
+   * Tests adding a display.
+   */
+  public function testAddDisplay() {
+    $view = array(
+    );
+    $view = $this->randomView($view);
+    $this->assertNoText('Block');
+    $this->assertNoText('Block 2');
+
+    $this->drupalPostForm(NULL, [], t('Add @display', ['@display' => 'Block']));
+    $this->assertText('Block');
+    $this->assertNoText('Block 2');
+
+    $this->drupalPostForm(NULL, [], 'Block');
+    $this->assertText('Block');
+    $this->assertText('Block 2');
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  protected function handleForm(&$post, &$edit, &$upload, $submit, $form) {
+    $result = parent::handleForm($post, $edit, $upload, $submit, $form);
+    // We override the method to be able to post 'Block' as button. Views has
+    // its own special form handling in views_ui_form_button_was_clicked() to be
+    // able to change the submit button text via JS.
+    // By passing 'Block' as the button we are able to simulate what the JS is
+    // doing.
+    if ($submit === 'Block') {
+      $post['op'] = 'Block';
+      $result = TRUE;
+    }
+    return $result;
+  }
+
+  /**
    * Tests reordering of displays.
    */
   public function testReorderDisplay() {
