settings: Fix filtering users based on role.

This bug was introduced in 174a458928 as `this` parameter
passed to role_selected_handler was DropdownWidget instance
and not the Jquery element for the selected role option.
This commit is contained in:
Sahil Batra 2024-11-12 17:39:31 +05:30 committed by Tim Abbott
parent 8eab7591a3
commit 54595f80cc
1 changed files with 1 additions and 2 deletions

View File

@ -172,7 +172,6 @@ function add_value_to_filters(
} }
function role_selected_handler( function role_selected_handler(
this: HTMLElement,
event: JQuery.ClickEvent, event: JQuery.ClickEvent,
dropdown: tippy.Instance, dropdown: tippy.Instance,
widget: dropdown_widget.DropdownWidget, widget: dropdown_widget.DropdownWidget,
@ -180,7 +179,7 @@ function role_selected_handler(
event.preventDefault(); event.preventDefault();
event.stopPropagation(); event.stopPropagation();
const role_code = Number($(this).attr("data-unique-id")); const role_code = Number($(event.currentTarget).attr("data-unique-id"));
if (widget.widget_name === active_section.dropdown_widget_name) { if (widget.widget_name === active_section.dropdown_widget_name) {
add_value_to_filters(active_section, "role_code", role_code); add_value_to_filters(active_section, "role_code", role_code);
} else if (widget.widget_name === deactivated_section.dropdown_widget_name) { } else if (widget.widget_name === deactivated_section.dropdown_widget_name) {