user_groups: Do not enable "Add" button if input is empty.

This makes sure that the "Add" button in members panel is
not enabled if the pill input is empty, in two cases - when
the members panel is opened and also when the members panel
is live-updated due to change in permission.
This commit is contained in:
Sahil Batra 2024-10-31 13:27:24 +05:30 committed by Tim Abbott
parent aed8ac9672
commit 50674a7a28
1 changed files with 3 additions and 1 deletions

View File

@ -88,7 +88,9 @@ function update_add_members_elements(group) {
if (settings_data.can_add_members_to_user_group(group.id)) {
$input_element.prop("contenteditable", true);
$button_element.prop("disabled", false);
if (user_group_edit_members.pill_widget.items().length !== 0) {
$button_element.prop("disabled", false);
}
$button_element.css("pointer-events", "");
$add_members_container[0]._tippy?.destroy();
$add_members_container.removeClass("add_members_disabled");