We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6d12ecb commit 6eb5586Copy full SHA for 6eb5586
widgets/+wt/ListSelector.m
@@ -439,12 +439,18 @@ function onButtonPushed(obj,evt)
439
function promptToAddListItems(obj)
440
% Prompt a dialog to add items to the listbox
441
442
+ % Take ItemsData into account while displaying Items
443
+ items = obj.Items;
444
+ if ~isempty(obj.ItemsData)
445
+ items = items(1:min(numel(items), numel(obj.ItemsData)));
446
+ end
447
+
448
% Prompt for stuff to add
449
if obj.AllowDuplicates
- newSelIdx = listdlg("ListString",obj.Items);
450
+ newSelIdx = listdlg("ListString",items);
451
else
452
newSelIdx = listdlg(...
- "ListString",obj.Items,...
453
+ "ListString",items,...
454
"InitialValue",obj.ListBox.ItemsData);
455
end
456
0 commit comments