compose: Fix opening stream picker by triggering click event.

We should trigger click event to open up the dropdown popup instead of using
`.dropdown("toggle")` because we want to clear the search state when opening up
the popup and the logic for that is registered in `on-click` handler defined in
`dropdown_list_widget`.

Fixes: #25218
This commit is contained in:
Lalit
2023-04-21 08:49:45 +05:30
committed by Tim Abbott
parent 9192098326
commit 2d118f098a

View File

@@ -94,7 +94,10 @@ export function open_compose_stream_dropup() {
if ($("#id_compose_select_stream").hasClass("open")) {
return;
}
$("#id_compose_select_stream > .dropdown-toggle").dropdown("toggle");
// We trigger a click rather than directly toggling the element;
// this is important to ensure the filter text gets cleared when
// reopening the widget after previous use.
$("#id_compose_select_stream > .dropdown-toggle").trigger("click");
}
export function on_compose_select_stream_update(new_value) {