diff --git a/core/misc/dialog/dialog.ajax.js b/core/misc/dialog/dialog.ajax.js
index 2139872..987318b 100644
--- a/core/misc/dialog/dialog.ajax.js
+++ b/core/misc/dialog/dialog.ajax.js
@@ -70,7 +70,7 @@
           'text': $originalButton.html() || $originalButton.attr('value'),
           'class': $originalButton.attr('class'),
           'click': function (e) {
-            $originalButton.trigger('mousedown').trigger('click').trigger('mouseup');
+            $originalButton.trigger('mousedown').trigger('mouseup').trigger('click');
             e.preventDefault();
           }
         });
diff --git a/core/modules/views/src/Ajax/SetFormCommand.php b/core/modules/views/src/Ajax/SetFormCommand.php
new file mode 100644
index 0000000..3027953
--- /dev/null
+++ b/core/modules/views/src/Ajax/SetFormCommand.php
@@ -0,0 +1,46 @@
+<?php
+
+/**
+ * @file
+ * Contains \Drupal\views\Ajax\SetFormCommand.
+ */
+
+namespace Drupal\views\Ajax;
+
+use Drupal\Core\Ajax\CommandInterface;
+
+/**
+ * Provides an AJAX command for setting a form in the views edit modal.
+ *
+ * This command is implemented in Drupal.AjaxCommands.prototype.viewsSetForm.
+ */
+class SetFormCommand implements CommandInterface {
+
+  /**
+   * The URL of the form.
+   *
+   * @var string
+   */
+  protected $url;
+
+  /**
+   * Constructs a SetFormCommand object.
+   *
+   * @param string $url
+   *   The URL of the form.
+   */
+  public function __construct($url) {
+    $this->url = $url;
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function render() {
+    return array(
+      'command' => 'viewsSetForm',
+      'url' => $this->url,
+    );
+  }
+
+}
diff --git a/core/modules/views/src/Plugin/views/filter/FilterPluginBase.php b/core/modules/views/src/Plugin/views/filter/FilterPluginBase.php
index 9abf63e..a91b312 100644
--- a/core/modules/views/src/Plugin/views/filter/FilterPluginBase.php
+++ b/core/modules/views/src/Plugin/views/filter/FilterPluginBase.php
@@ -411,7 +411,6 @@ protected function showBuildGroupButton(&$form, FormStateInterface $form_state)
         '#type' => 'submit',
         '#value' => $this->t('Grouped filters'),
         '#submit' => array(array($this, 'buildGroupForm')),
-        '#attributes' => array('class' => array('use-ajax-submit')),
       );
       $form['group_button']['radios']['radios']['#default_value'] = 0;
     }
@@ -421,7 +420,6 @@ protected function showBuildGroupButton(&$form, FormStateInterface $form_state)
         '#type' => 'submit',
         '#value' => $this->t('Single filter'),
         '#submit' => array(array($this, 'buildGroupForm')),
-        '#attributes' => array('class' => array('use-ajax-submit')),
       );
       $form['group_button']['radios']['radios']['#default_value'] = 1;
     }
@@ -486,7 +484,6 @@ public function showExposeButton(&$form, FormStateInterface $form_state) {
         '#type' => 'submit',
         '#value' => $this->t('Expose filter'),
         '#submit' => array(array($this, 'displayExposedForm')),
-        '#attributes' => array('class' => array('use-ajax-submit')),
       );
       $form['expose_button']['checkbox']['checkbox']['#default_value'] = 0;
     }
@@ -499,7 +496,6 @@ public function showExposeButton(&$form, FormStateInterface $form_state) {
         '#type' => 'submit',
         '#value' => $this->t('Hide filter'),
         '#submit' => array(array($this, 'displayExposedForm')),
-        '#attributes' => array('class' => array('use-ajax-submit')),
       );
       $form['expose_button']['checkbox']['checkbox']['#default_value'] = 1;
     }
@@ -1074,7 +1070,6 @@ protected function buildExposedFiltersGroupForm(&$form, FormStateInterface $form
       '#type' => 'submit',
       '#value' => $this->t('Add another item'),
       '#submit' => array(array($this, 'addGroupForm')),
-      '#attributes' => array('class' => array('use-ajax-submit')),
     );
 
     $js = array();
diff --git a/core/modules/views/src/Plugin/views/sort/SortPluginBase.php b/core/modules/views/src/Plugin/views/sort/SortPluginBase.php
index 8fe2b43..192ce58 100644
--- a/core/modules/views/src/Plugin/views/sort/SortPluginBase.php
+++ b/core/modules/views/src/Plugin/views/sort/SortPluginBase.php
@@ -124,7 +124,6 @@ public function showExposeButton(&$form, FormStateInterface $form_state) {
         '#type' => 'submit',
         '#value' => $this->t('Expose sort'),
         '#submit' => array(array($this, 'displayExposedForm')),
-        '#attributes' => array('class' => array('use-ajax-submit')),
       );
       $form['expose_button']['checkbox']['checkbox']['#default_value'] = 0;
     }
@@ -137,7 +136,6 @@ public function showExposeButton(&$form, FormStateInterface $form_state) {
         '#type' => 'submit',
         '#value' => $this->t('Hide sort'),
         '#submit' => array(array($this, 'displayExposedForm')),
-        '#attributes' => array('class' => array('use-ajax-submit')),
       );
       $form['expose_button']['checkbox']['checkbox']['#default_value'] = 1;
     }
diff --git a/core/modules/views_ui/js/ajax.js b/core/modules/views_ui/js/ajax.js
index e693493..6d23f88 100644
--- a/core/modules/views_ui/js/ajax.js
+++ b/core/modules/views_ui/js/ajax.js
@@ -11,6 +11,24 @@
     $(response.selector).addClass('hilited');
   };
 
+  Drupal.AjaxCommands.prototype.viewsSetForm = function (ajax, response, status) {
+    var $form = $('.views-ui-dialog form');
+    // Identify the button that was clicked so that .ajaxSubmit() can use it.
+    // We need to do this for both .click() and .mousedown() since JavaScript
+    // code might trigger either behavior.
+    var $submit_buttons = $form.find('input[type=submit], button');
+    $submit_buttons.on('click mousedown', function() {
+      this.form.clk = this;
+    });
+    $form.once('views-ajax-submit').each(function() {
+      var element_settings = { 'url': response.url, 'event': 'submit', 'progress': { 'type': 'throbber' } };
+      var $form = $(this);
+      var id = $form.attr('id');
+      Drupal.ajax[id] = new Drupal.ajax(id, this, element_settings);
+      Drupal.ajax[id].$form = $form;
+    });
+  };
+
   Drupal.AjaxCommands.prototype.viewsShowButtons = function (ajax, response, status) {
     $('div.views-edit-view div.form-actions').removeClass('js-hide');
     if (response.changed) {
diff --git a/core/modules/views_ui/src/Form/Ajax/ConfigHandler.php b/core/modules/views_ui/src/Form/Ajax/ConfigHandler.php
index 28a7323..c1e2da22 100644
--- a/core/modules/views_ui/src/Form/Ajax/ConfigHandler.php
+++ b/core/modules/views_ui/src/Form/Ajax/ConfigHandler.php
@@ -181,9 +181,6 @@ public function buildForm(array $form, FormStateInterface $form_state, Request $
         '#value' => $this->t('Remove'),
         '#submit' => array(array($this, 'remove')),
         '#limit_validation_errors' => array(array('override')),
-        '#ajax' => array(
-          'url' => Url::fromRoute('<current>'),
-        ),
       );
     }
 
diff --git a/core/modules/views_ui/src/Form/Ajax/ViewsFormBase.php b/core/modules/views_ui/src/Form/Ajax/ViewsFormBase.php
index 17a31c1..fdc9e89 100644
--- a/core/modules/views_ui/src/Form/Ajax/ViewsFormBase.php
+++ b/core/modules/views_ui/src/Form/Ajax/ViewsFormBase.php
@@ -94,6 +94,7 @@ public function getForm(ViewEntityInterface $view, $display_id, $js) {
     // Reset the cache of IDs. Drupal rather aggressively prevents ID
     // duplication but this causes it to remember IDs that are no longer even
     // being used.
+    Html::setAjaxHtmlIds();
     Html::resetSeenIds();
 
     // check to see if this is the top form of the stack. If it is, pop
@@ -236,6 +237,12 @@ protected function ajaxFormWrapper($form_class, FormStateInterface &$form_state)
 
       $response->addCommand(new OpenModalDialogCommand($title, $display, $options));
 
+      // Views provides its own custom handling of AJAX form submissions.
+      // Usually this happens at the same path, but custom paths may be
+      // specified in $form_state.
+      $form_url = $form_state->has('url') ? $form_state->get('url')->toString() : $this->url('<current>');
+      $response->addCommand(new Ajax\SetFormCommand($form_url));
+
       if ($section = $form_state->get('#section')) {
         $response->addCommand(new Ajax\HighlightCommand('.' . Html::cleanCssIdentifier($section)));
       }
diff --git a/core/modules/views_ui/src/ViewUI.php b/core/modules/views_ui/src/ViewUI.php
index 5aeac87..9102f4f 100644
--- a/core/modules/views_ui/src/ViewUI.php
+++ b/core/modules/views_ui/src/ViewUI.php
@@ -315,11 +315,6 @@ public function getStandardButtons(&$form, FormStateInterface $form_state, $form
       $names = array(t('Apply'), t('Apply and continue'));
     }
 
-    // Views provides its own custom handling of AJAX form submissions. Usually
-    // this happens at the same path, but custom paths may be specified in
-    // $form_state.
-    $form_url = $form_state->get('url') ?: Url::fromRouteMatch(\Drupal::routeMatch());
-
     // Forms that are purely informational set an ok_button flag, so we know not
     // to create an "Apply" button for them.
     if (!$form_state->get('ok_button')) {
@@ -334,9 +329,6 @@ public function getStandardButtons(&$form, FormStateInterface $form_state, $form
         // take care of running the regular submit handler as appropriate.
         '#submit' => array(array($this, 'standardSubmit')),
         '#button_type' => 'primary',
-        '#ajax' => array(
-          'url' => $form_url,
-        ),
       );
       // Form API button click detection requires the button's #value to be the
       // same between the form build of the initial page request, and the
@@ -362,9 +354,6 @@ public function getStandardButtons(&$form, FormStateInterface $form_state, $form
       '#value' => !$form_state->get('ok_button') ? t('Cancel') : t('Ok'),
       '#submit' => array($cancel_submit),
       '#validate' => array(),
-      '#ajax' => array(
-        'path' => $form_url,
-      ),
       '#limit_validation_errors' => array(),
     );
 
