From 54595f80cccf192c850d6876b5a728a8939d1887 Mon Sep 17 00:00:00 2001 From: Sahil Batra Date: Tue, 12 Nov 2024 17:39:31 +0530 Subject: [PATCH] settings: Fix filtering users based on role. This bug was introduced in 174a4589281 as `this` parameter passed to role_selected_handler was DropdownWidget instance and not the Jquery element for the selected role option. --- web/src/settings_users.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/web/src/settings_users.ts b/web/src/settings_users.ts index 55c8f5a602..50276b2ed7 100644 --- a/web/src/settings_users.ts +++ b/web/src/settings_users.ts @@ -172,7 +172,6 @@ function add_value_to_filters( } function role_selected_handler( - this: HTMLElement, event: JQuery.ClickEvent, dropdown: tippy.Instance, widget: dropdown_widget.DropdownWidget, @@ -180,7 +179,7 @@ function role_selected_handler( event.preventDefault(); 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) { add_value_to_filters(active_section, "role_code", role_code); } else if (widget.widget_name === deactivated_section.dropdown_widget_name) {