Merge pull request #3957 from IgorA100/patch-69

Fix: If Select has no Options, don't try to select 1 Option in Filter page
pull/3949/head^2
Isaac Connor 2024-04-08 12:32:56 -04:00 committed by GitHub
commit ab106aaf8f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 3 deletions

View File

@ -382,9 +382,10 @@ function addTerm( element ) {
var row = $j(element).closest('tr');
row.find('select').chosen('destroy');
var newRow = row.clone().insertAfter(row);
newRow.find('select').each( function() { //reset new row to default
this[0].selected = 'selected';
});
//newRow.find('select').each( function() { //reset new row to default
// if ($j(this).find('option').length > 0 )
// this[0].selected = 'selected';
//});
newRow.find('input[type="text"]').val('');
newRow[0].querySelectorAll("button[data-on-click-this]").forEach(function(el) {
var fnName = el.getAttribute("data-on-click-this");