From 6e50ef573fc1cf53f68c6920009e038192da0fdb Mon Sep 17 00:00:00 2001 From: tobiascapin Date: Thu, 11 Jan 2024 10:27:00 +0100 Subject: [PATCH] Ignore move for disabled options --- src/jquery.bootstrap-duallistbox.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/jquery.bootstrap-duallistbox.js b/src/jquery.bootstrap-duallistbox.js index 93e0423..9859e16 100644 --- a/src/jquery.bootstrap-duallistbox.js +++ b/src/jquery.bootstrap-duallistbox.js @@ -254,7 +254,7 @@ dualListbox.elements.select1.find('option:selected').each(function(index, item) { var $item = $(item); - if (!$item.data('filtered1')) { + if (!$item.data('filtered1') && !$item.prop("disabled")) { changeSelectionState(dualListbox, $item.data('original-index'), true); } }); @@ -301,7 +301,7 @@ dualListbox.element.find('option').each(function(index, item) { var $item = $(item); - if (!$item.data('filtered1')) { + if (!$item.data('filtered1') && !$item.prop("disabled")) { $item.prop('selected', true); $item.attr('data-sortindex', dualListbox.sortIndex); dualListbox.sortIndex++;