mirror of
https://github.com/zulip/zulip.git
synced 2025-11-09 16:37:23 +00:00
dropdown_widget: Fix bug in disable_for_spectators
If `disable_for_spectators` is true, the widget text is greyed out but the tippy instance is still delegated, causing it to appear on click/enter. This commit fixes that by not delegating tippy if the `disable_for_spectators` is true. This bug was surfaced when it was found that the topic type filter in Recent conversations has disabled styling for spectators, but a spectator could still click on it to open the dropdown. Fixes #30461
This commit is contained in:
@@ -179,6 +179,11 @@ export class DropdownWidget {
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.disable_for_spectators && page_params.is_spectator) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.instance = tippy.delegate(delegate_container, {
|
||||
...popover_menus.default_popover_props,
|
||||
target: this.widget_selector,
|
||||
|
||||
Reference in New Issue
Block a user