From 57821e7052ede9abf7c832a6b85fbae8e3838f8b Mon Sep 17 00:00:00 2001 From: Xabi Date: Fri, 17 May 2024 12:09:04 +0200 Subject: [PATCH] =?UTF-8?q?Correcci=C3=B3n=20para=20el=20m=C3=A9todo=20cle?= =?UTF-8?q?ar=20de=20rup=5Fselect?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit No funcionaba cuando se trataba de reiniciar una instancia con la propiedad multiple activa. (cherry picked from commit 7f00e4db0ef1e008b8e33c1f60670c58d65c1866) --- src/rup.select.js | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/rup.select.js b/src/rup.select.js index 6fc76eed..c8a1210a 100644 --- a/src/rup.select.js +++ b/src/rup.select.js @@ -227,14 +227,19 @@ var $self = $(this); // init de select if (this.length > 0) { + const settings = $self.data('settings'); var dataSelect2 = $self.data('select2'); dataSelect2.$selection.find('input').val(''); // Simple y multi - if($self.data('settings').blank !== undefined){ - $self.rup_select('setRupValue', $self.data('settings').blank); - }else{ - $self.rup_select('setRupValue', null); - } + if (settings.blank !== undefined) { + if (settings.multiple) { + $self.rup_select('setRupValue', [$self.data('settings').blank]); + } else { + $self.rup_select('setRupValue', $self.data('settings').blank); + } + } else { + $self.rup_select('setRupValue', null); + } } }, /**