diff --git a/core/modules/views_ui/src/ViewPreviewForm.php b/core/modules/views_ui/src/ViewPreviewForm.php
index f132b64..0d7d37b 100644
--- a/core/modules/views_ui/src/ViewPreviewForm.php
+++ b/core/modules/views_ui/src/ViewPreviewForm.php
@@ -71,17 +71,21 @@ public function form(array $form, FormStateInterface $form_state) {
     );
 
     // Add the arguments textfield
+    if (!empty($form_state['values']['view_args'])) {
+      $preview_args = $form_state['values']['view_args'];
+    }
+    else {
+      $preview_args = \Drupal::request()->query->get('_preview_args');
+    }
     $form['controls']['view_args'] = array(
       '#type' => 'textfield',
       '#title' => $this->t('Preview with contextual filters:'),
       '#description' => $this->t('Separate contextual filter values with a "/". For example, %example.', array('%example' => '40/12/10')),
       '#id' => 'preview-args',
+      '#default_value' => $preview_args,
     );
 
-    $args = array();
-    if (!$form_state->isValueEmpty('view_args')) {
-      $args = explode('/', $form_state->getValue('view_args'));
-    }
+    $args = !empty($preview_args) ? explode('/', $preview_args) : array();
 
     $user_input = $form_state->getUserInput();
     if ($form_state->get('show_preview') || !empty($user_input['js'])) {
diff --git a/core/modules/views_ui/src/ViewUI.php b/core/modules/views_ui/src/ViewUI.php
index 31af296..d657cd6 100644
--- a/core/modules/views_ui/src/ViewUI.php
+++ b/core/modules/views_ui/src/ViewUI.php
@@ -555,9 +555,6 @@ public function endQueryCapture() {
   }
 
   public function renderPreview($display_id, $args = array()) {
-    // Save the current path so it can be restored before returning from this function.
-    $old_q = current_path();
-
     // Determine where the query and performance statistics should be output.
     $config = \Drupal::config('views.settings');
     $show_query = $config->get('ui.show.sql_query.enabled');
@@ -604,15 +601,9 @@ public function renderPreview($display_id, $args = array()) {
         $path = $this->executable->getUrl();
       }
 
-      // Make view links come back to preview.
-      $this->override_path = 'admin/structure/views/view/' . $this->id() . '/preview/' . $display_id;
-
-      // Also override the current path so we get the pager.
-      $original_path = current_path();
-      $q = _current_path($this->override_path);
+      // Store contextual filters in a request query parameter for the pager.
       if ($args) {
-        $q .= '/' . implode('/', $args);
-        _current_path($q);
+        \Drupal::request()->query->set('_preview_args', implode('/', $args));
       }
 
       // Suppress contextual links of entities within the result set during a
@@ -642,8 +633,7 @@ public function renderPreview($display_id, $args = array()) {
       views_ui_contextual_links_suppress_pop();
 
       // Reset variables.
-      unset($this->override_path);
-      _current_path($original_path);
+      \Drupal::request()->query->remove('_preview_args');
 
       // Prepare the query information and statistics to show either above or
       // below the view preview.
@@ -756,7 +746,6 @@ public function renderPreview($display_id, $args = array()) {
       $output .= $preview . drupal_render($table);
     }
 
-    _current_path($old_q);
     return $output;
   }
 
