diff -u b/core/modules/views_ui/js/views-admin.js b/core/modules/views_ui/js/views-admin.js --- b/core/modules/views_ui/js/views-admin.js +++ b/core/modules/views_ui/js/views-admin.js @@ -449,13 +449,12 @@ $target.closest('tr').find('input').trigger('click'); }); - // Add a keyup handler to the search box. - this.$searchBox = this.$form.find('[data-drupal-selector="edit-override-controls-options-search"]'); - this.$searchBox.on('keyup', $.proxy(this.handleFilter, this)); - - // Handles group filtering. - this.$filterType = this.$form.find('[data-drupal-selector="edit-override-controls-group"]'); - this.$filterType.on('change', $.proxy(this.handleFilter, this)); + var searchBoxSelector = '[data-drupal-selector="edit-override-controls-options-search"]'; + var controlGroupSelector = '[data-drupal-selector="edit-override-controls-group"]'; + this.$form.on('formUpdated', searchBoxSelector + ',' + controlGroupSelector, $.proxy(this.handleFilter, this)); + + this.$searchBox = this.$form.find(searchBoxSelector); + this.$controlGroup = this.$form.find(controlGroupSelector); /** * Get a list of option labels and their corresponding divs and maintain it @@ -510,7 +509,7 @@ * options. * * @param {jQuery.Event} event - * The keyup event or change event. + * The formUpdated event. */ handleFilter: function (event) { // Determine the user's search query. The search text has been converted @@ -518,7 +517,7 @@ var search = this.$searchBox.val().toLowerCase(); var words = search.split(' '); // Get selected Group - var group = this.$filterType.val(); + var group = this.$controlGroup.val(); // Search through the search texts in the form for matching text. this.options.forEach(function (option) { @@ -538,6 +537,7 @@ option.$div.toggle(found); }); + // Adapt dialog to content size. $(event.target).trigger('dialogContentResize'); } only in patch2: unchanged: --- a/core/modules/views_ui/views_ui.libraries.yml +++ b/core/modules/views_ui/views_ui.libraries.yml @@ -10,6 +10,7 @@ views_ui.admin: - core/drupalSettings - core/jquery.once - core/jquery.form + - core/drupal.form - core/drupal.ajax - core/drupal.dropbutton - views/views.ajax