fixes #2837 - select2 nullable filter fields add multiple null_option elements when paging

This commit is contained in:
John Anderson
2019-01-31 13:56:36 -05:00
parent ac614130b2
commit 45843d22b4
2 changed files with 3 additions and 2 deletions

View File

@@ -197,8 +197,8 @@ $(document).ready(function() {
return obj;
});
// Handle the null option
if (element.getAttribute('data-null-option')) {
// Handle the null option, but only add it once
if (element.getAttribute('data-null-option') && data.previous === null) {
var null_option = $(element).children()[0]
results.unshift({
id: null_option.value,