Skip to content

Commit

Permalink
[7018] Item selector does not enforce its maximum count limit #7018 (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
jvega190 authored Jul 18, 2024
1 parent 94991e4 commit 84eca07
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,14 @@ YAHOO.extend(CStudioForms.Controls.NodeSelector, CStudioForms.CStudioFormField,
$dropdown.append($addBtn);
$dropdown.append($dropdownMenu);

// Prevent dropdown from opening if the items' limit has been reached.
$dropdown.on('show.bs.dropdown', function (e) {
const itemsLeftCount = _self.getItemsLeftCount();
if (itemsLeftCount === 0) {
e.preventDefault();
}
});

$(nodeOptionsEl).append($dropdown);

if (this.readonly == true) {
Expand Down

0 comments on commit 84eca07

Please sign in to comment.