Skip to content

Commit

Permalink
Corrección para el método clear de rup_select
Browse files Browse the repository at this point in the history
No funcionaba cuando se trataba de reiniciar una instancia con la propiedad multiple activa.

(cherry picked from commit 7f00e4d)
  • Loading branch information
xaabi6 committed May 17, 2024
1 parent 544adf9 commit 57821e7
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions src/rup.select.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
},
/**
Expand Down

0 comments on commit 57821e7

Please sign in to comment.