Commit 28101b8d authored by Sergey Shadrin's avatar Sergey Shadrin

[#124455] Applied patch for `select2` to be compatible with `better_exposed_filters`

parent 4f19dc8f
......@@ -213,6 +213,10 @@
},
"drupal/admin_toolbar": {
"Replace icons": "./patches/admin_toolbar/replace-icons.patch"
},
"drupal/select2": {
"3271205: Removing selected option sometimes needs multiple clicks": "https://www.drupal.org/files/issues/2022-04-20/select2-check-indexes-3271205-8.patch",
"3450644: BEF 7.0 compatible": "https://git.drupalcode.org/project/select2/-/merge_requests/36/diffs.patch"
}
}
}
......
This file was automatically generated by Composer Patches (https://github.com/cweagans/composer-patches)
Patches applied to this directory:
3271205: Removing selected option sometimes needs multiple clicks
Source: https://www.drupal.org/files/issues/2022-04-20/select2-check-indexes-3271205-8.patch
3450644: BEF 7.0 compatible
Source: https://git.drupalcode.org/project/select2/-/merge_requests/36/diffs.patch
......@@ -65,11 +65,12 @@
var $list = $select.next('.select2-container').find('ul.select2-selection__rendered');
Sortable.create($list[0], {
draggable: 'li:not(.select2-search)',
forceFallback: true,
onEnd: function () {
$($list.find('.select2-selection__choice').get().reverse()).each(function () {
$select.prepend($select.find('option[value="' + $(this).data('optionValue') + '"]').first());
});
onEnd: function (event) {
if (event.newIndex != event.oldIndex) {
$($list.find('.select2-selection__choice').get().reverse()).each(function () {
$select.prepend($select.find('option[value="' + $(this).data('optionValue') + '"]').first());
});
}
}
});
}
......
......@@ -18,7 +18,7 @@ class Select2 extends FilterWidgetBase {
/**
* {@inheritdoc}
*/
public function defaultConfiguration() {
public function defaultConfiguration(): array {
$config = parent::defaultConfiguration();
$config['advanced']['placeholder_text'] = (string) $this->t('- None -');
return $config;
......@@ -50,7 +50,7 @@ class Select2 extends FilterWidgetBase {
/**
* {@inheritdoc}
*/
public function buildConfigurationForm(array $form, FormStateInterface $form_state) {
public function buildConfigurationForm(array $form, FormStateInterface $form_state): array {
$form = parent::buildConfigurationForm($form, $form_state);
......
......@@ -18,7 +18,7 @@ class Select2 extends SortWidgetBase {
/**
* {@inheritdoc}
*/
public function exposedFormAlter(array &$form, FormStateInterface $form_state) {
public function exposedFormAlter(array &$form, FormStateInterface $form_state): void {
parent::exposedFormAlter($form, $form_state);
foreach ($this->sortElements as $element) {
......
......@@ -7280,6 +7280,10 @@
"status": "covered",
"message": "Covered by Drupal's security advisory policy"
}
},
"patches_applied": {
"3271205: Removing selected option sometimes needs multiple clicks": "https://www.drupal.org/files/issues/2022-04-20/select2-check-indexes-3271205-8.patch",
"3450644: BEF 7.0 compatible": "https://git.drupalcode.org/project/select2/-/merge_requests/36/diffs.patch"
}
},
"installation-source": "dist",
......
......@@ -3,7 +3,7 @@
'name' => 'drupal/recommended-project',
'pretty_version' => '10.3.x-dev',
'version' => '10.3.9999999.9999999-dev',
'reference' => '9de4fa8f139a1dbb429554dbed8ed94c84636e1a',
'reference' => '4f19dc8f8ba92f05854f788c444ee7092814d94b',
'type' => 'project',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
......@@ -1030,7 +1030,7 @@
'drupal/recommended-project' => array(
'pretty_version' => '10.3.x-dev',
'version' => '10.3.9999999.9999999-dev',
'reference' => '9de4fa8f139a1dbb429554dbed8ed94c84636e1a',
'reference' => '4f19dc8f8ba92f05854f788c444ee7092814d94b',
'type' => 'project',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment